.clew-coming-soon {
	max-width: 720px;
	margin: 60px auto;
	padding: 60px 40px;
	text-align: center;
	background: linear-gradient(180deg, #16131f 0%, #241c33 100%);
	color: #f1ecf9;
	border-radius: 14px;
	font-family: Georgia, 'Times New Roman', serif;
}
.clew-coming-soon .clew-eyebrow {
	letter-spacing: .2em;
	text-transform: uppercase;
	font-size: 12px;
	color: #b79df0;
	margin-bottom: 18px;
	font-family: Arial, sans-serif;
}
.clew-coming-soon h1 {
	font-size: 42px;
	margin: 0 0 18px;
	color: #ffffff;
}
.clew-coming-soon p.tagline {
	font-size: 18px;
	line-height: 1.6;
	color: #d5c9ef;
	margin-bottom: 32px;
}
.clew-coming-soon .clew-progress-wrap {
	max-width: 320px;
	margin: 0 auto 12px;
	background: rgba(255,255,255,0.1);
	border-radius: 20px;
	overflow: hidden;
	height: 10px;
}
.clew-coming-soon .clew-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #8a5cf6, #d18cf0);
}
.clew-coming-soon .clew-progress-label {
	font-family: Arial, sans-serif;
	font-size: 12px;
	color: #a999cf;
	letter-spacing: .05em;
}
.clew-coming-soon .clew-footer-note {
	margin-top: 36px;
	font-family: Arial, sans-serif;
	font-size: 12px;
	color: #7c6f96;
}

/* Vitality Bridge card */
.clew-vitality-card {
	max-width: 560px;
	margin: 24px auto;
	padding: 28px;
	border-radius: 12px;
	background: #1b1626;
	color: #f1ecf9;
	font-family: Arial, sans-serif;
}
.clew-vitality-notice {
	background: rgba(255,255,255,0.08);
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	margin-bottom: 16px;
}
.clew-vitality-wallet {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}
.clew-vitality-stat {
	text-align: center;
}
.clew-vitality-num {
	display: block;
	font-size: 26px;
	font-weight: 700;
	color: #d18cf0;
}
.clew-vitality-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #a999cf;
	margin-top: 2px;
}
.clew-vitality-activity p {
	font-size: 14px;
	margin: 4px 0;
	color: #d5c9ef;
}
.clew-vitality-activity p.description {
	font-size: 12px;
	color: #8a7cae;
}
.clew-vitality-convert-btn {
	margin-top: 14px;
	background: linear-gradient(90deg, #8a5cf6, #d18cf0);
	color: #fff;
	border: none;
	padding: 10px 22px;
	border-radius: 24px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.clew-vitality-convert-btn:disabled {
	opacity: .6;
	cursor: default;
}
.clew-vitality-result {
	margin-top: 10px;
	font-size: 13px;
	color: #b79df0;
	min-height: 16px;
}

/* Marketplace / Inventory */
.clew-market {
	max-width: 720px;
	margin: 24px auto;
}
.clew-market-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	font-family: Arial, sans-serif;
}
.clew-market-balance {
	font-size: 14px;
	color: #4a3b6b;
}
.clew-market-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
}
.clew-market-card {
	background: #1b1626;
	color: #f1ecf9;
	border-radius: 10px;
	padding: 14px;
	text-align: center;
	font-family: Arial, sans-serif;
}
.clew-market-card-icon {
	font-size: 32px;
	margin-bottom: 8px;
}
.clew-market-card-icon img {
	max-width: 60px;
	max-height: 60px;
	border-radius: 6px;
}
.clew-market-card-name {
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 4px;
}
.clew-market-card-desc {
	font-size: 11px;
	color: #a999cf;
	margin-bottom: 8px;
}
.clew-market-card-price {
	font-size: 12px;
	color: #d18cf0;
	margin-bottom: 10px;
}
.clew-market-buy-btn {
	background: linear-gradient(90deg, #8a5cf6, #d18cf0);
	color: #fff;
	border: none;
	padding: 6px 16px;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}
.clew-market-buy-btn:disabled {
	opacity: .6;
	cursor: default;
}
.clew-inventory-list h3 {
	font-family: Arial, sans-serif;
}

/* Submit form */
.clew-submit-form {
	max-width: 560px;
	margin: 24px auto;
	padding: 24px;
	border-radius: 12px;
	background: #1b1626;
	color: #f1ecf9;
	font-family: Arial, sans-serif;
}
.clew-submit-form h3 {
	margin-top: 0;
	color: #fff;
}
.clew-submit-form label {
	display: block;
	font-size: 13px;
	color: #a999cf;
	margin: 12px 0 4px;
}
.clew-submit-form select,
.clew-submit-form textarea,
.clew-submit-form input[type="text"] {
	width: 100%;
	padding: 8px 10px;
	border-radius: 6px;
	border: 1px solid rgba(255,255,255,0.2);
	background: rgba(255,255,255,0.05);
	color: #f1ecf9;
	font-family: inherit;
	box-sizing: border-box;
}
/* Guards against theme/global stylesheets that set a white focus background
   on form fields — without this, the textarea can go white-on-white (white
   text on the theme's white focus background) while actively typing. */
.clew-submit-form select:focus,
.clew-submit-form textarea:focus,
.clew-submit-form input[type="text"]:focus {
	background-color: #241c33 !important;
	color: #f1ecf9 !important;
	outline: 2px solid #8a5cf6;
	outline-offset: 1px;
}
.clew-submit-btn {
	margin-top: 14px;
	background: linear-gradient(90deg, #8a5cf6, #d18cf0);
	color: #fff;
	border: none;
	padding: 10px 22px;
	border-radius: 24px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.clew-submit-history {
	margin-top: 20px;
}
.clew-submit-history-row {
	padding: 8px 0;
	border-top: 1px solid rgba(255,255,255,0.1);
}
.clew-submit-history-main {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
}
.clew-submit-history-text {
	font-size: 12px;
	color: #a999cf;
	margin-top: 2px;
}
.clew-submit-status {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 10px;
}
.clew-submit-status-approved { background: #1f4d2e; color: #8ee6a8; }
.clew-submit-status-rejected { background: #4d1f22; color: #e68e94; }
.clew-submit-status-pending { background: #4d3f1f; color: #e6c98e; }

/* Live Dashboard */
.clew-live-dashboard {
	max-width: 1100px;
	margin: 24px auto;
	font-family: Arial, sans-serif;
	color: #f1ecf9;
}

/* Hotsheet — public, curated stories only */
.clew-hotsheet {
	background: #1b1626;
	border-radius: 12px;
	padding: 24px;
}
.clew-hotsheet h3 {
	margin-top: 0;
	color: #fff;
}
.clew-hotsheet-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}
.clew-hotsheet-cols-2 .clew-hotsheet-grid {
	grid-template-columns: 1fr 1fr;
}
@media (max-width: 640px) {
	.clew-hotsheet-cols-2 .clew-hotsheet-grid {
		grid-template-columns: 1fr;
	}
}
.clew-hotsheet-story {
	background: rgba(255,255,255,0.03);
	border-radius: 10px;
	overflow: hidden;
}
.clew-hotsheet-story-image img {
	width: 100%;
	aspect-ratio: 16/9;
	object-fit: cover;
	display: block;
}
.clew-hotsheet-story-body {
	padding: 16px;
}
.clew-hotsheet-story-title {
	margin: 0 0 4px;
	color: #fff;
	font-size: 18px;
}
.clew-hotsheet-story-when {
	font-size: 11px;
	color: #7c6f96;
	margin-bottom: 10px;
}
.clew-hotsheet-story-text {
	font-size: 14px;
	color: #d5c9ef;
	line-height: 1.6;
}
.clew-hotsheet-story-text p {
	margin: 0 0 10px;
}
.clew-hotsheet-story-related {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid rgba(255,255,255,0.1);
	font-size: 12px;
	color: #a999cf;
}
.clew-hotsheet-story-related-label {
	color: #7c6f96;
	margin-right: 4px;
}

/* Console tabs */
.clew-console-topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}
.clew-console-tabs {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	flex: 1 1 auto;
}
.clew-console-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	background: linear-gradient(180deg, #221a33 0%, #191325 100%);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 12px;
	color: #a999cf;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	padding: 14px 22px;
	cursor: pointer;
	flex: 1 1 100px;
	min-width: 90px;
	transition: border-color .15s ease, color .15s ease;
}
.clew-console-tab-icon {
	font-size: 20px;
	line-height: 1;
}
.clew-console-tab:hover {
	color: #f1ecf9;
	border-color: rgba(209,140,240,0.4);
}
.clew-console-tab.is-active {
	color: #fff;
	border-color: #d18cf0;
	box-shadow: 0 0 0 1px rgba(209,140,240,0.4), 0 0 18px rgba(138,92,246,0.35);
}
.clew-console-panel {
	display: none !important;
}
.clew-console-panel.is-active {
	display: block !important;
}

/* Topbar stats — replaces the old large avatar/hero header card entirely;
   just the live cycle counter + wallet balance, sized to sit inline next
   to the tab row rather than as a separate block. */
.clew-console-topbar-stats {
	display: flex;
	align-items: center;
	gap: 18px;
	flex: 0 0 auto;
	padding: 8px 4px;
	white-space: nowrap;
}
.clew-console-topbar-stat {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.2;
}
.clew-console-topbar-stat-label {
	font-size: 9px;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: #7c6f96;
}
.clew-console-topbar-stat-value {
	font-size: 15px;
	font-weight: 700;
	color: #d18cf0;
}
.clew-console-topbar-cycle .clew-console-topbar-stat-value {
	color: #fff;
}
.clew-console-topbar-login {
	font-size: 12px;
	font-weight: 700;
	color: #d18cf0;
	text-decoration: none;
	border: 1px solid rgba(209,140,240,0.4);
	border-radius: 8px;
	padding: 6px 12px;
}
.clew-console-topbar-login:hover {
	color: #fff;
	border-color: #d18cf0;
}
@media (max-width: 600px) {
	.clew-console-topbar {
		flex-direction: column;
	}
	.clew-console-topbar-stats {
		align-self: flex-start;
	}
}


/* Character roster */
.clew-roster h3,
.clew-locations-roster h3 {
	margin-top: 0;
	color: #fff;
}
.clew-roster-grid,
.clew-locations-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
}
.clew-roster-card,
.clew-locations-card {
	background: #1b1626;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.clew-roster-avatar img,
.clew-locations-card-image img {
	width: 100%;
	aspect-ratio: 4/3;
	object-fit: cover;
	display: block;
}
.clew-roster-avatar-placeholder {
	width: 100%;
	aspect-ratio: 4/3;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 40px;
	background: rgba(255,255,255,0.06);
}
.clew-roster-body,
.clew-locations-card-body {
	padding: 14px;
}
.clew-roster-body h4,
.clew-locations-card-body h4 {
	margin: 0 0 4px;
	color: #fff;
}
.clew-roster-tagline,
.clew-locations-card-region {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #b79df0;
	margin-bottom: 8px;
}
.clew-roster-bio,
.clew-locations-card-desc {
	font-size: 13px;
	color: #d5c9ef;
	margin: 0 0 12px;
	line-height: 1.5;
}
.clew-roster-message-btn,
.clew-locations-view-map-btn {
	background: linear-gradient(90deg, #8a5cf6, #d18cf0);
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}


.clew-submit-actions-remaining {
	font-size: 13px;
	color: #d18cf0;
	background: rgba(255,255,255,0.06);
	padding: 8px 12px;
	border-radius: 8px;
	margin-bottom: 14px;
}
.clew-submit-actions-empty {
	color: #e6c98e;
}

.clew-worldmap {
	max-width: 900px;
	margin: 24px auto;
	font-family: Arial, sans-serif;
}
.clew-worldmap-image-wrap {
	position: relative;
	display: inline-block;
	max-width: 100%;
	border-radius: 10px;
	overflow: hidden;
}
.clew-worldmap-image {
	display: block;
	max-width: 100%;
}
.clew-worldmap-pin {
	position: absolute;
	width: 18px;
	height: 18px;
	margin-left: -9px;
	margin-top: -18px;
	background: #d18cf0;
	border: 2px solid #fff;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 2px 5px rgba(0,0,0,0.4);
	cursor: pointer;
	padding: 0;
}
.clew-worldmap-pin:hover {
	background: #8a5cf6;
}
.clew-worldmap-pin-character {
	background: #57c8ff;
	border-radius: 50%;
	transform: none;
	width: 14px;
	height: 14px;
	margin-left: -7px;
	margin-top: -7px;
	box-shadow: 0 0 8px rgba(87,200,255,.7);
}
.clew-worldmap-pin-character:hover {
	background: #8adeff;
}
.clew-worldmap-popup {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #1b1626;
	color: #f1ecf9;
	border-radius: 12px;
	padding: 20px;
	max-width: 400px;
	width: 90%;
	z-index: 9999;
	box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.clew-worldmap-popup h4 {
	margin: 0 0 4px;
	color: #fff;
}
.clew-worldmap-popup-region {
	font-size: 12px;
	color: #a999cf;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: .05em;
}
.clew-worldmap-popup img {
	max-width: 100%;
	border-radius: 8px;
	margin-bottom: 10px;
}
.clew-worldmap-popup p {
	font-size: 14px;
	line-height: 1.5;
	color: #d5c9ef;
}
.clew-worldmap-popup-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	color: #f1ecf9;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
}

/* ==================================================================
   Conversations ([conversation] shortcode)
   ================================================================== */

.clew-conversation {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.clew-conversation-locked p {
	margin: 0;
	padding: 20px;
}

/* ---- Wallet tile: mirrors the Marketplace/topbar stat treatment ---- */
.clew-conversation-wallet {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: center;
	padding: 10px 16px;
	background: #12151c;
	color: #f4f6fb;
}

.clew-conversation-wallet-item {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.clew-conversation-wallet-label {
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.65;
}

.clew-conversation-wallet-value {
	font-size: 16px;
	font-weight: 700;
}

.clew-conversation-wallet-cost .clew-conversation-wallet-value {
	color: #ffc46b;
}

.clew-conversation-wallet-memory {
	margin-left: auto;
	text-align: right;
}

.clew-conversation-wallet-memory .clew-conversation-wallet-value {
	font-size: 13px;
	font-weight: 600;
	opacity: 0.8;
}

/* ---- Layout ---- */
.clew-conversation-body {
	display: flex;
	align-items: stretch;
}

.clew-conversation-rail {
	width: 240px;
	flex: 0 0 240px;
	border-right: 1px solid rgba( 0, 0, 0, 0.1 );
	padding: 14px;
	background: #f7f8fa;
	overflow-y: auto;
}

.clew-conversation-rail-block + .clew-conversation-rail-block {
	margin-top: 20px;
}

/* Rail sections (8.3.60): the rail is grouped into clearly marked,
   shaded sections — Talk, Blend conversations, Memory, World, Web
   surfing, Your conversations — so each function reads as its own
   block instead of one long run of panels. */
.clew-conversation-rail-section {
	background: rgba( 255, 255, 255, 0.72 );
	border: 1px solid rgba( 0, 0, 0, 0.09 );
	border-radius: 10px;
	padding: 12px;
	margin-bottom: 16px;
}
.clew-conversation-rail-section:last-child {
	margin-bottom: 0;
}
.clew-conversation-rail-section-title {
	font-size: 13px;
	font-weight: 700;
	margin: 0 0 10px;
	padding-bottom: 8px;
	border-bottom: 2px solid rgba( 0, 0, 0, 0.12 );
}
.clew-conversation-rail-section .clew-conversation-rail-block {
	background: transparent;
	border: 0;
	padding: 0;
}
.clew-conversation-rail-section .clew-conversation-rail-block + .clew-conversation-rail-block {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px dashed rgba( 0, 0, 0, 0.12 );
}

.clew-conversation-rail-title {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.6;
	margin-bottom: 6px;
}

.clew-conversation-rail select {
	width: 100%;
	max-width: 100%;
	padding: 6px;
}

.clew-conversation-dual select,
.clew-conversation-dual input[type="number"] {
	width: 100%;
	margin: 4px 0 8px;
}
.clew-conversation-dual .clew-conversation-hint {
	margin: 6px 0;
}

/* Group conversation (8.3.75): the same green family as the
   "Appending complete" panel, so the group reads as its own
   function beside Dual and Blend. */
.clew-conversation-rail-section-group {
	background: #eef7ee;
	border-color: #b7dfb7;
}

/* API presets (8.3.76): the 🔀 rail section — a violet tint of
   its own, so the preset picker reads as a setup switch, not
   part of the Blend section below it. */
.clew-conversation-rail-section-api-preset {
	background: #f3f0fd;
	border-color: #cdbcf3;
}
.clew-conversation-api-preset select {
	width: 100%;
	max-width: 100%;
}
.clew-conversation-group select,
.clew-conversation-group input[type="number"] {
	width: 100%;
	margin: 4px 0 8px;
}
.clew-conversation-group .clew-conversation-hint {
	margin: 6px 0;
}
.clew-conversation-group-lineup {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}
.clew-conversation-group-lineup li {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 6px;
	background: rgba( 255, 255, 255, 0.7 );
	border: 1px solid rgba( 0, 0, 0, 0.08 );
	border-radius: 6px;
	margin-bottom: 4px;
}
.clew-conversation-group-member-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.clew-conversation-group-lineup button {
	flex: 0 0 auto;
	background: transparent;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 4px;
	cursor: pointer;
	padding: 1px 7px;
	line-height: 1.4;
}
.clew-conversation-group-lineup button:disabled {
	opacity: 0.35;
	cursor: default;
}
.clew-conversation-group-addrow {
	display: flex;
	gap: 6px;
	margin-bottom: 8px;
}
.clew-conversation-group-addrow select {
	flex: 1;
	min-width: 0;
	margin: 0;
}
.clew-conversation-group-check {
	display: block;
	margin: 6px 0;
}
.clew-conversation-group-next {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border: 1px solid #b7dfb7;
	border-radius: 8px;
	padding: 8px 10px;
	margin: 8px 0;
}
.clew-conversation-group-next[hidden] {
	display: none;
}
.clew-conversation-group-next span {
	flex: 1;
}

/* Append to thread (8.3.32): the weave toggle in the rail. The select
   itself is covered by the generic rail select rule above. */
.clew-conversation-append-toggle {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	margin: 2px 0 8px;
}
.clew-conversation-append-toggle input[type="checkbox"] {
	margin-top: 2px;
}
.clew-conversation-append select {
	width: 100%;
	margin: 4px 0 8px;
}
.clew-conversation-append .clew-conversation-hint {
	margin: 6px 0;
}

/* External conversation (8.4.41): label, file picker and pasted
   transcript in the Blend section — full-width inputs like the
   Append pickers above them. */
.clew-conversation-external input[type="text"],
.clew-conversation-external textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 6px;
	margin: 4px 0 8px;
}
.clew-conversation-external textarea {
	font-family: inherit;
	resize: vertical;
}
.clew-conversation-external input[type="file"] {
	width: 100%;
	max-width: 100%;
	margin: 4px 0 8px;
}
.clew-conversation-external .clew-conversation-hint {
	margin: 6px 0;
}

/* Stepped Append (8.3.60): numbered steps with a circled number
   beside each, so the flow reads as 1 → 2 → 3 at a glance. */
.clew-conversation-append-step {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 10px 0;
}
.clew-conversation-append-step-num {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	line-height: 22px;
	text-align: center;
	border-radius: 50%;
	background: #1d2327;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	margin-top: 2px;
}
.clew-conversation-append-step-body {
	flex: 1;
	min-width: 0;
}
.clew-conversation-append-step-body .clew-conversation-hint {
	margin: 0 0 4px;
}

/* "Appending complete" panel (8.3.60): a green-tinted box so the
   finished blend is unmistakable, with the Unappend button inside. */
[data-clew-conv-append-complete] {
	background: #eef7ee;
	border: 1px solid #b7dfb7;
	border-radius: 8px;
	padding: 10px;
	margin: 10px 0;
}
[data-clew-conv-append-complete][hidden] {
	display: none;
}

/* Flickers tab (8.3.60): one card per blend, with its date, both
   sides, status, and undo. */
.clew-conversation-flicker {
	background: rgba( 255, 255, 255, 0.85 );
	border: 1px solid rgba( 0, 0, 0, 0.1 );
	border-radius: 8px;
	padding: 10px;
	margin: 8px 0;
}
.clew-conversation-flicker-head {
	font-size: 12px;
	font-weight: 700;
	margin: 0 0 4px;
}
.clew-conversation-flicker .clew-conversation-hint {
	margin: 4px 0;
}
.clew-conversation-flicker details {
	margin-top: 6px;
}
.clew-conversation-flicker summary {
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
}

/* Blend confirmation modal (8.3.39): a fixed overlay naming both
   agents before a weave is enabled or retargeted. */
.clew-conversation-blend-modal {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	padding: 16px;
}
.clew-conversation-blend-modal[hidden] {
	display: none;
}
.clew-conversation-blend-dialog {
	background: #fff;
	color: #1d2327;
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	max-width: 440px;
	width: 100%;
	padding: 20px;
	font-size: 14px;
	line-height: 1.55;
}
.clew-conversation-blend-title {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 8px;
}
.clew-conversation-blend-dialog p {
	margin: 8px 0;
}
.clew-conversation-blend-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

/* Undo weave + archived blends (8.3.38) */
.clew-conversation-append-archive {
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	padding: 6px 0;
}
.clew-conversation-append-archive summary {
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
}

/* Blend controls (8.3.71): one Excise row per source thread woven
   into this one — its count beside its Excise-these button. */
.clew-conversation-blend-excise-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	padding: 6px 0;
}
.clew-conversation-blend-excise-row .clew-conversation-hint {
	margin: 0;
}

/* Range excise (8.3.72): the bar above the transcript, and the red
   marking of a stretch in the thread itself. */
.clew-conversation-range {
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 8px;
	padding: 8px 10px;
	margin-bottom: 10px;
}
.clew-conversation-range .clew-conversation-hint {
	margin: 6px 0;
}
.clew-conversation-range [data-clew-conv-range-actions],
.clew-conversation-range [data-clew-conv-range-confirm-panel] {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}
.clew-conversation-range [data-clew-conv-range-actions][hidden],
.clew-conversation-range [data-clew-conv-range-confirm-panel][hidden] {
	display: none;
}
/* While marking, a message reads as tappable. */
.clew-conversation-transcript.is-range-marking .clew-conversation-msg[data-clew-msg-id],
.clew-conversation-transcript.is-range-marking .clew-conversation-story-event[data-clew-msg-id] {
	cursor: pointer;
}
.clew-conversation-transcript.is-range-marking .clew-conversation-msg[data-clew-msg-id]:focus,
.clew-conversation-transcript.is-range-marking .clew-conversation-story-event[data-clew-msg-id]:focus {
	outline: 2px solid #dc2626;
	outline-offset: 2px;
}
/* The marked stretch outlines in red; first / last carry a chip. */
.clew-conversation-msg.is-range-marked,
.clew-conversation-story-event.is-range-marked {
	outline: 2px solid #dc2626;
	outline-offset: 2px;
	border-radius: 8px;
}
.clew-conversation-range-chip {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 999px;
	padding: 1px 8px;
	margin-top: 4px;
}
.clew-conversation-mediaset-clock {
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

/* Web surfing (8.3.40) */
.clew-conversation-surf input[type="url"],
.clew-conversation-surf textarea,
.clew-conversation-surf select {
	width: 100%;
	margin: 2px 0 6px;
}
.clew-conversation-surf-grid {
	display: grid;
	grid-template-columns: 1fr 1.2fr 1fr;
	gap: 6px;
}
.clew-conversation-surf-grid input,
.clew-conversation-surf-grid select {
	width: 100%;
}
.clew-conversation-surf-job {
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	padding: 8px 0 4px;
	margin-top: 8px;
}
.clew-conversation-surf-job-url {
	font-size: 12px;
	font-weight: 600;
	margin: 0 0 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.clew-conversation-surf-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}
.clew-conversation-surf-job summary {
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	margin-top: 6px;
}

.clew-conversation-rail-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 8px;
}

.clew-conversation-btn {
	cursor: pointer;
	border-radius: 6px;
	border: 1px solid transparent;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 600;
}

.clew-conversation-btn-primary {
	background: #2a5bd7;
	color: #fff;
}

.clew-conversation-btn-primary:hover:not( :disabled ) {
	background: #1f47ab;
}

.clew-conversation-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.clew-conversation-btn-ghost {
	background: transparent;
	border-color: rgba( 0, 0, 0, 0.2 );
	color: inherit;
}

.clew-conversation-btn-ghost:hover {
	background: rgba( 0, 0, 0, 0.05 );
}

.clew-conversation-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.clew-conversation-list-item {
	display: flex;
	flex-direction: column;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	border-radius: 6px;
	padding: 7px 8px;
	cursor: pointer;
}

.clew-conversation-list-item:hover,
.clew-conversation-list-item.is-active {
	background: rgba( 42, 91, 215, 0.1 );
}

.clew-conversation-list-name {
	font-weight: 600;
	font-size: 13px;
}

.clew-conversation-list-time {
	font-size: 11px;
	opacity: 0.6;
}

/* ---- Thread ---- */
.clew-conversation-thread {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.clew-conversation-thread-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	font-weight: 600;
}

.clew-conversation-status {
	font-size: 12px;
	font-weight: 500;
	opacity: 0.7;
}

.clew-conversation-status.is-error {
	color: #b32d2e;
	opacity: 1;
}

.clew-conversation-transcript {
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.clew-conversation-empty {
	margin: auto;
	text-align: center;
	opacity: 0.55;
	font-size: 13px;
}

.clew-conversation-msg {
	max-width: 78%;
	display: flex;
	flex-direction: column;
}

.clew-conversation-msg-user {
	align-self: flex-end;
	align-items: flex-end;
}

.clew-conversation-msg-character {
	align-self: flex-start;
}

.clew-conversation-bubble {
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
	line-height: 1.5;
	font-size: 14px;
}

.clew-conversation-msg-user .clew-conversation-bubble {
	background: #2a5bd7;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.clew-conversation-msg-character .clew-conversation-bubble {
	background: #eef0f4;
	color: #14171f;
	border-bottom-left-radius: 4px;
}

.clew-conversation-msg.is-thinking .clew-conversation-bubble {
	opacity: 0.55;
	font-style: italic;
}

.clew-conversation-time {
	font-size: 10px;
	opacity: 0.5;
	margin-top: 3px;
	padding: 0 4px;
}

/* ---- Composer (8.3.14): tools in one uniform row above, the input
   full-width below. The old single row squeezed the textarea between
   four buttons; the input is where the words go, so it gets the
   width and the buttons get their own row. ---- */

.clew-conversation-composer {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
}

.clew-conversation-composer-tools {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

/* One height for every tool, icon or text, so the row reads as a
   row rather than four unrelated controls. */
.clew-conversation-composer-tools .clew-conversation-btn,
.clew-conversation-composer-tools .clew-conversation-attach-btn,
.clew-conversation-composer-tools .clew-conversation-camera-btn {
	height: 36px;
	min-height: 36px;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.clew-conversation-composer-tools .clew-conversation-btn {
	padding: 0 14px;
}

.clew-conversation-composer-tools .clew-conversation-attach-btn,
.clew-conversation-composer-tools .clew-conversation-camera-btn {
	width: 36px;
	padding: 0;
}

.clew-conversation-composer-input {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.clew-conversation-composer-input textarea {
	flex: 1 1 auto;
	min-width: 0;
	resize: vertical;
	min-height: 42px;
	padding: 9px 11px;
	border-radius: 8px;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
	font-family: inherit;
	font-size: 14px;
}

.clew-conversation-composer-input textarea:disabled {
	background: #f2f3f5;
}

.clew-conversation-composer-input .clew-conversation-btn {
	flex: 0 0 auto;
	align-self: flex-end;
}

.clew-roster-talk-btn {
	margin-left: 6px;
}

@media ( max-width: 782px ) {
	.clew-conversation-body {
		flex-direction: column;
	}

	/* 8.4.11: on a phone the chat comes first and the settings
	   live below it — the rail used to sit on top and push the
	   chat to the bottom of the page. */
	.clew-conversation-rail {
		width: auto;
		flex: 1 1 auto;
		order: 2;
		border-right: 0;
		border-top: 1px solid rgba( 0, 0, 0, 0.1 );
	}

	/* Live Avatar dock (8.3.69): the dock lives inside the
	   thread column now, so it stacks at the thread's top
	   on its own below the breakpoint — no order rule here. */

	.clew-conversation-thread {
		order: 1;
	}

	.clew-conversation-msg {
		max-width: 90%;
	}

	.clew-conversation-wallet-memory {
		margin-left: 0;
		text-align: left;
	}

	/* 8.4.11: the chat is the thing on a phone — give it the
	   screen. The transcript's height comes from an inline
	   style (460px by default), so the override needs
	   !important; 65vh makes the chat large instead of a
	   strip under the settings. */
	.clew-conversation-transcript {
		height: 65vh !important;
		min-height: 440px;
		padding: 12px;
	}

	.clew-conversation-bubble {
		font-size: 15px;
	}

	/* 16px on the composer input stops iOS zooming the page
	   in when the player taps to type. */
	.clew-conversation-composer-input textarea {
		font-size: 16px;
	}

	/* 8.4.13: on a narrow thread the four fixed controls
	   (attach, sphere, mic, send) eat the whole composer
	   row and leave the textarea a slit — measured 42px
	   wide on a phone, one character per line, so neither
	   typing nor a dictation landing in it could be read.
	   The textarea takes its own full-width line, three
	   lines tall, and the controls drop to a tools row
	   below it, send pinned to the right. */
	.clew-conversation-composer-input {
		flex-wrap: wrap;
	}
	.clew-conversation-composer-input textarea {
		flex: 1 1 100%;
		order: 1;
		min-height: 72px;
	}
	.clew-conversation-composer-input .clew-conversation-attach-btn {
		order: 2;
	}
	.clew-conversation-composer-input .clew-conversation-api-sphere {
		order: 3;
	}
	.clew-conversation-composer-input .clew-conversation-mic-btn {
		order: 4;
	}
	.clew-conversation-composer-input .clew-conversation-send-btn {
		order: 5;
		margin-left: auto;
	}

	/* Six bar buttons across a phone is a squeeze — three
	   per row, with room to tap. */
	.clew-conversation-bar-btn {
		flex: 1 1 30%;
		min-height: 52px;
		padding: 10px 4px;
		font-size: 13px;
	}
}

/* ---- Conversation: avatars, story events, link badge ---- */

.clew-conversation-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

.clew-conversation-msg-user .clew-conversation-row {
	justify-content: flex-end;
}

.clew-conversation-thread-header {
	/* name + optional story badge on the left, status pushed right */
	justify-content: flex-start;
}

.clew-conversation-thread-header .clew-conversation-status {
	margin-left: auto;
}

.clew-conversation-story-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
	background: rgba( 42, 91, 215, 0.12 );
	color: #2a5bd7;
	white-space: nowrap;
}

.clew-conversation-story-event {
	align-self: center;
	max-width: 92%;
	text-align: center;
	border-top: 1px dashed rgba( 0, 0, 0, 0.15 );
	border-bottom: 1px dashed rgba( 0, 0, 0, 0.15 );
	padding: 7px 10px;
	margin: 2px 0;
}

.clew-conversation-story-event-text {
	font-size: 12.5px;
	font-style: italic;
	line-height: 1.5;
	opacity: 0.75;
	white-space: pre-wrap;
}

.clew-conversation-story-event .clew-conversation-attached-img {
	display: block;
	max-width: 100%;
	border-radius: 8px;
	margin: 0 auto 6px;
}

/* ---- Worlds live (8.3.48): the 🌍 World rail block ---- */

.clew-conversation-world-here {
	font-weight: 600;
	margin: 6px 0;
}

.clew-conversation-world-img {
	max-width: 100%;
	border-radius: 8px;
	display: block;
	margin: 6px 0;
}

.clew-conversation-world-exits {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 6px 0;
}

.clew-conversation-hint {
	font-size: 11px;
	line-height: 1.45;
	opacity: 0.6;
	margin: 6px 0 0;
}

.clew-conversation-rail select:disabled {
	opacity: 0.6;
}

/* ---- Rail portrait: the selected persona, shown once in the sidebar ---- */

.clew-conversation-rail-portrait {
	width: 100%;
	aspect-ratio: 1 / 1;
	max-height: 190px;
	margin: 10px 0 4px;
	border-radius: 10px;
	overflow: hidden;
	background: #d8dce4;
	display: flex;
	align-items: center;
	justify-content: center;
}

.clew-conversation-rail-portrait img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.clew-conversation-rail-portrait-placeholder {
	font-size: 44px;
	font-weight: 700;
	color: #6b7280;
	user-select: none;
}

.clew-conversation-rail-portrait-name {
	font-weight: 600;
	font-size: 14px;
	text-align: center;
	margin-bottom: 10px;
}

@media ( max-width: 782px ) {
	/* On a stacked layout a full-width square portrait would push the
	   transcript off-screen, so shrink it to a chip. */
	.clew-conversation-rail-portrait {
		width: 64px;
		height: 64px;
		max-height: 64px;
		margin: 8px auto 4px;
	}

	.clew-conversation-rail-portrait-placeholder {
		font-size: 26px;
	}
}

/* ---- Generated images in the transcript ---- */

.clew-conversation-image {
	align-self: flex-start;
	max-width: 78%;
	border-radius: 12px;
	overflow: hidden;
	background: #eef0f4;
}

.clew-conversation-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

.clew-conversation-image.is-pending {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 150px;
	width: 260px;
	padding: 20px;
	border: 1px dashed rgba( 0, 0, 0, 0.18 );
	background: repeating-linear-gradient(
		45deg,
		#f3f4f7,
		#f3f4f7 10px,
		#eceef3 10px,
		#eceef3 20px
	);
}

.clew-conversation-image-spinner {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 3px solid rgba( 42, 91, 215, 0.25 );
	border-top-color: #2a5bd7;
	animation: clew-conv-spin 0.9s linear infinite;
}

@keyframes clew-conv-spin {
	to { transform: rotate( 360deg ); }
}

.clew-conversation-image-label {
	font-size: 12px;
	opacity: 0.65;
}

.clew-conversation-image.is-failed {
	padding: 12px 14px;
	font-size: 12.5px;
	color: #b32d2e;
	background: rgba( 179, 45, 46, 0.07 );
	border: 1px solid rgba( 179, 45, 46, 0.2 );
}

@media ( prefers-reduced-motion: reduce ) {
	.clew-conversation-image-spinner { animation: none; }
}

@media ( max-width: 782px ) {
	.clew-conversation-image { max-width: 90%; }
	.clew-conversation-image.is-pending { width: 100%; }
}

.clew-conversation-image.is-curated {
	background: transparent;
}

.clew-conversation-image-caption {
	font-size: 11px;
	opacity: 0.55;
	padding: 4px 2px 0;
	font-style: italic;
}

/* ---- Attaching an image to a conversation ---- */

.clew-conversation-attach-btn {
	flex: 0 0 auto;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 10px 8px;
	border-radius: 8px;
	opacity: 0.6;
	user-select: none;
}

.clew-conversation-attach-btn:hover {
	opacity: 1;
	background: rgba( 0, 0, 0, 0.05 );
}

 /* An author-level display rule outranks the browser's built-in
   [hidden] { display: none }, so hiding this panel by setting the
   hidden attribute silently did nothing. This restores it. */
.clew-conversation-attach-preview[hidden] {
	display: none;
}

.clew-conversation-attach-preview {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	background: #f7f8fa;
}

.clew-conversation-attach-preview img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	flex: 0 0 56px;
}

/* Text-file preview (8.3.22): filename + first lines, in the same slot
   the thumbnail occupies for images. Monospace, capped, scrollable —
   a long file must not push the composer off the screen. */
.clew-conversation-attach-text[hidden] {
	display: none;
}

.clew-conversation-attach-text {
	flex: 0 0 120px;
	max-width: 120px;
	max-height: 56px;
	overflow: hidden;
	white-space: pre-wrap;
	word-break: break-word;
	font-family: ui-monospace, monospace;
	font-size: 11px;
	line-height: 1.35;
	font-style: normal;
	padding: 6px 8px;
	border-radius: 6px;
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	color: inherit;
	opacity: 1;
}

.clew-conversation-attach-meta {
	flex: 1 1 auto;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12px;
	line-height: 1.45;
	opacity: 0.75;
	font-style: italic;
}

.clew-conversation-attach-remove {
	margin-left: auto;
	background: transparent;
	border: 0;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.5;
	padding: 0 4px;
}

.clew-conversation-attach-remove:hover { opacity: 1; }

.clew-conversation-attached-img {
	display: block;
	max-width: 100%;
	border-radius: 8px;
	margin-bottom: 6px;
}

/* ---- Save photo to memory (8.3.21) ---- */
/* Small and quiet under the photo — it is an offer, not a demand. */
.clew-conversation-save-photo {
	display: inline-block;
	margin-top: 4px;
	padding: 3px 8px;
	font-size: 12px;
	line-height: 1.4;
	border-radius: 6px;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	background: transparent;
	color: inherit;
	opacity: 0.7;
	cursor: pointer;
}

.clew-conversation-save-photo:hover {
	opacity: 1;
	background: rgba( 0, 0, 0, 0.05 );
}

.clew-conversation-save-photo:disabled {
	opacity: 0.55;
	cursor: default;
}

.clew-conversation-attach-desc {
	flex: 1 1 auto;
	min-height: 44px;
	resize: vertical;
	font-family: inherit;
	font-size: 12px;
	line-height: 1.45;
	font-style: italic;
	padding: 6px 8px;
	border-radius: 6px;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	background: #fff;
	color: inherit;
}

/* ---- Media set (8.3.33) ---- */
/* The 📎 set queue: same slot family as the single-attachment
   preview (above the composer, rail-grey background), one row per
   file in pick order with its send state. */
.clew-conversation-mediaset[hidden] {
	display: none;
}

.clew-conversation-mediaset {
	padding: 10px 12px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	background: #f7f8fa;
}

.clew-conversation-mediaset-head {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.clew-conversation-mediaset-title {
	font-weight: 700;
	font-size: 13px;
}

.clew-conversation-mediaset-status {
	font-size: 12px;
	opacity: 0.75;
}

.clew-conversation-mediaset-list {
	list-style: none;
	margin: 8px 0;
	padding: 0;
	display: grid;
	gap: 5px;
}

.clew-conversation-mediaset-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
}

.clew-conversation-mediaset-item img {
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: 6px;
	flex: 0 0 36px;
}

.clew-conversation-mediaset-icon {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
}

.clew-conversation-mediaset-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.clew-conversation-mediaset-state {
	flex: 0 0 auto;
	font-size: 12px;
	opacity: 0.75;
}

.clew-conversation-mediaset-item.is-sent .clew-conversation-mediaset-state {
	opacity: 1;
	font-weight: 600;
}

.clew-conversation-mediaset-item.is-failed .clew-conversation-mediaset-state {
	color: #b32d2e;
	opacity: 1;
}

.clew-conversation-mediaset-remove {
	background: transparent;
	border: 0;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.5;
	padding: 0 4px;
}

.clew-conversation-mediaset-remove:hover { opacity: 1; }

.clew-conversation-mediaset-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.clew-conversation-mediaset-interval {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
}

.clew-conversation-mediaset-interval input {
	width: 64px;
}

/* ---- Pull from a Flickella project (8.3.37) ---- */
/* Sits directly above the Media set panel it feeds, in the same
   slot family: project picker + pull button on one wrapping row. */
.clew-conversation-flickella-pull {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	background: #f7f8fa;
}

.clew-conversation-flickella-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
}

.clew-conversation-flickella-label select {
	max-width: 260px;
	font-weight: 400;
}

.clew-conversation-flickella-pull .clew-conversation-hint {
	flex: 1 1 100%;
	margin: 0;
}

/* ---- Dated conversation saves (8.3.23) ---- */
/* One tab per persona per date. A <details> per tab keeps the rail
   short: the transcript only loads when the tab is opened, and the
   Archived folder below keeps old tabs out of the way. */
.clew-conversation-save-tab {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 6px;
	margin: 6px 0;
	background: #fff;
}

.clew-conversation-save-tab summary {
	cursor: pointer;
	padding: 7px 10px;
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
}

.clew-conversation-save-tab.is-archived {
	opacity: 0.65;
}

.clew-conversation-save-count {
	font-weight: 400;
	opacity: 0.7;
	font-size: 12px;
	white-space: nowrap;
}

.clew-conversation-save-actions {
	display: flex;
	gap: 6px;
	padding: 0 10px 8px;
}

.clew-conversation-save-actions .clew-conversation-btn {
	font-size: 12px;
	padding: 3px 8px;
}

.clew-conversation-save-text {
	margin: 0 10px 10px;
	padding: 8px;
	max-height: 240px;
	overflow: auto;
	white-space: pre-wrap;
	word-break: break-word;
	font-family: ui-monospace, monospace;
	font-size: 12px;
	line-height: 1.5;
	background: #f7f8fa;
	border: 1px solid rgba( 0, 0, 0, 0.08 );
	border-radius: 6px;
}

/* ---- SightKind camera panel (8.3.11) ---- */

.clew-conversation-camera-btn {
	flex: 0 0 auto;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 10px 8px;
	border-radius: 8px;
	border: 0;
	background: transparent;
	opacity: 0.6;
	user-select: none;
}

.clew-conversation-camera-btn:hover {
	opacity: 1;
	background: rgba( 0, 0, 0, 0.05 );
}

/* ---- Microphone button (8.3.20) ---- */

.clew-conversation-mic-btn {
	flex: 0 0 auto;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 10px 8px;
	border-radius: 8px;
	border: 0;
	background: transparent;
	/* 8.4.12: full opacity — at 0.6 the mic read as disabled on
	   touch screens, where there is no hover to brighten it. */
	opacity: 1;
	user-select: none;
}

.clew-conversation-mic-btn:hover {
	opacity: 1;
	background: rgba( 0, 0, 0, 0.05 );
}

/* Recording: red and fully opaque — the state must read at a glance,
   the same way the Talk toggle's is-on state does. */
.clew-conversation-mic-btn.is-recording {
	opacity: 1;
	color: #b32d2e;
	background: rgba( 179, 45, 46, 0.08 );
}

/* Same [hidden] trap as the attach preview above: an author-level
   display rule outranks the browser's built-in [hidden], so the panel
   needs its own explicit rule or it never hides. */
.clew-conversation-camera[hidden] {
	display: none;
}

.clew-conversation-camera {
	display: block;
	padding: 10px 12px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	background: #f7f8fa;
}

.clew-conversation-camera video {
	display: block;
	width: 100%;
	max-width: 480px;
	border-radius: 8px;
	background: #000;
}

.clew-conversation-camera-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	flex-wrap: wrap;
}

/* Autosight toggle: green while a session is running, so the state is
   visible at a glance rather than only in the status line. */
.clew-conversation-btn.is-on {
	background: #e6f4ea;
	border-color: #1a7f37;
	color: #1a7f37;
}

/* ==================================================================
   [text2image]
   ================================================================== */

.clew-t2i {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 10px;
	padding: 14px;
	background: #fff;
}

.clew-t2i-bar {
	display: flex;
	gap: 14px;
	margin-bottom: 8px;
}

.clew-t2i-meta {
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.6;
}

.clew-t2i textarea {
	width: 100%;
	resize: vertical;
	padding: 10px;
	border-radius: 8px;
	border: 1px solid rgba( 0, 0, 0, 0.18 );
	font-family: inherit;
	font-size: 14px;
}

.clew-t2i-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
	flex-wrap: wrap;
	font-size: 13px;
}

.clew-t2i-controls select {
	margin-left: 6px;
	padding: 4px 6px;
}

.clew-t2i-btn {
	background: #2a5bd7;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 9px 18px;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
}

.clew-t2i-btn:hover:not( :disabled ) { background: #1f47ab; }
.clew-t2i-btn:disabled { opacity: 0.55; cursor: progress; }

.clew-t2i-status {
	font-size: 12px;
	opacity: 0.7;
}

.clew-t2i-status.is-error {
	color: #b32d2e;
	opacity: 1;
}

.clew-t2i-result {
	margin-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.clew-t2i-figure {
	margin: 0;
}

.clew-t2i-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.clew-t2i-figure figcaption {
	font-size: 11.5px;
	opacity: 0.6;
	margin-top: 5px;
	font-style: italic;
}

/* ---- Conversation list housekeeping ---- */

/* 8.3.92: each row is a vertical stack — the open button on top,
   the function buttons on their own line below the conversation
   title. They used to sit beside the row at its right edge and
   only appear on hover, where a tap could land on a neighbour. */
.clew-conversation-list-row {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.clew-conversation-list-row .clew-conversation-list-item {
	flex: 1 1 auto;
	min-width: 0;
}

.clew-conversation-list-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Inline rename (8.3.87): the input replaces the row title in
   place, so it takes the title's own line and never widens
   the row — it inherits the row's font and stays put. */
.clew-conversation-list-rename {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	font: inherit;
	/* 8.4.02: the field is white, so the text and the caret are
	   dark on purpose. It used to inherit the row's light sidebar
	   text, which on a white field made the typing — and the
	   caret — invisible. */
	color: #1d2327;
	caret-color: #1d2327;
	padding: 0 2px;
	border: 1px solid rgba( 0, 0, 0, 0.25 );
	border-radius: 3px;
	background: #fff;
}

.clew-conversation-list-rename::selection {
	background: #2271b1;
	color: #fff;
}

.clew-conversation-row-actions {
	/* 8.3.92: the second line of the row, below the conversation
	   title and always visible — no more hover-only, no more
	   crowding the right edge. Still never overlapping the open
	   button's click area: it is the row's own flex child under
	   it, not inside it. */
	display: flex;
	flex: 0 0 auto;
	gap: 2px;
	padding: 0 4px 4px 8px;
}

.clew-conversation-row-actions button {
	background: transparent;
	border: 0;
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
	/* A surer tap target (8.3.70): 24px square, so a tap lands on
	   the icon meant and not on the row beside it. */
	padding: 6px;
	min-width: 24px;
	min-height: 24px;
	border-radius: 4px;
	opacity: 0.55;
}

.clew-conversation-row-actions button:hover {
	opacity: 1;
	background: rgba( 0, 0, 0, 0.07 );
}

.clew-conversation-list-row.is-pinned {
	background: rgba( 42, 91, 215, 0.05 );
	border-radius: 6px;
}

.clew-conversation-pin-mark {
	font-size: 10px;
}

.clew-conversation-library {
	margin-top: 10px;
}

.clew-conversation-library > summary {
	cursor: pointer;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.55;
	padding: 4px 0;
}

/* ==================================================================
   [arena]
   ================================================================== */

.clew-arena {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 10px;
	padding: 18px;
	background: #fff;
	/* Explicit, not inherited: themes with a light body colour were
	   bleeding into this panel and washing the text out. */
	color: #1d2129;
}

.clew-arena-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	/* Was opacity:0.6, which disappeared against a cream page
	   background. A fixed grey keeps contrast wherever it lands. */
	color: #55606e;
	margin: 20px 0 10px;
}

.clew-arena-digest {
	background: #12151c;
	color: #f4f6fb;
	border-radius: 8px;
	padding: 14px 16px;
}

.clew-arena-digest-head {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9aa4b2;
	margin-bottom: 8px;
}

.clew-arena-digest-body p {
	margin: 0 0 8px;
	line-height: 1.55;
	font-size: 14px;
}

.clew-arena-board {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: arena;
}

.clew-arena-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 8px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.07 );
}

.clew-arena-row.is-me {
	background: rgba( 42, 91, 215, 0.07 );
	border-radius: 6px;
}

.clew-arena-rank {
	flex: 0 0 26px;
	font-weight: 700;
	/* 4.74:1 on white — rank numbers are content, not decoration, so
	   they need to clear AA rather than sit at UI-only contrast. */
	color: #6b7480;
	text-align: right;
}

.clew-arena-agent {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.clew-arena-for,
.clew-arena-sub {
	font-size: 11px;
	color: #626c7a;
}

.clew-arena-points {
	text-align: right;
	display: flex;
	flex-direction: column;
}

.clew-arena-points strong { font-size: 17px; }

.clew-arena-empty {
	color: #55606e;
	font-size: 13px;
}

.clew-arena-enrol {
	margin-top: 22px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	padding-top: 14px;
}

.clew-arena-field {
	display: block;
	margin-bottom: 12px;
	font-size: 13px;
}

.clew-arena-field > span {
	display: block;
	font-weight: 600;
	color: #1d2129;
	margin-bottom: 4px;
}

.clew-arena-field select,
.clew-arena-field input {
	width: 100%;
	max-width: 340px;
	padding: 7px 9px;
	border-radius: 6px;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
	font-family: inherit;
	font-size: 14px;
}

.clew-arena-check {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	font-size: 13px;
	line-height: 1.5;
	margin-bottom: 14px;
	max-width: 560px;
}

.clew-arena-check em {
	display: block;
	font-size: 11.5px;
	color: #626c7a;
	margin-top: 3px;
	font-style: normal;
}

.clew-arena-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.clew-arena-btn {
	background: #2a5bd7;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 9px 18px;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
}

.clew-arena-btn:disabled { opacity: 0.55; cursor: progress; }

.clew-arena-btn-ghost {
	background: transparent;
	color: inherit;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
}

.clew-arena-status { font-size: 12px; color: #55606e; }

/* Form controls inside the arena: themes often style inputs with a
   tinted background and pale text. Pin both so the panel stays legible
   regardless of the surrounding theme. */
.clew-arena-field input,
.clew-arena-field select,
.clew-arena-check {
	color: #1d2129;
}

.clew-arena-field input,
.clew-arena-field select {
	background: #fff;
}

.clew-arena-field input::placeholder {
	color: #8a929e;
	opacity: 1; /* Firefox dims placeholders by default. */
}

/* ---- Arena roster ---- */

.clew-arena-roster {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	color: #1d2129;
}

.clew-arena-roster th {
	text-align: left;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #55606e;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.12 );
	padding: 6px 8px;
}

.clew-arena-roster td {
	padding: 8px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.06 );
	vertical-align: middle;
}

.clew-arena-roster tr.is-out td {
	color: #6b7480;
}

.clew-arena-roster .clew-arena-sub {
	display: block;
}

.clew-arena-roster-agent {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.clew-arena-roster-agent img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
}

.clew-arena-live {
	color: #1a7f37;
	font-weight: 600;
}

/* ==================================================================
   Conversation export
   ================================================================== */

.clew-conversation-export-btn {
	margin-left: 8px;
	background: none;
	border: 1px solid rgba( 0, 0, 0, 0.18 );
	border-radius: 5px;
	padding: 3px 10px;
	font-size: 11.5px;
	font-family: inherit;
	color: inherit;
	cursor: pointer;
	white-space: nowrap;
}

.clew-conversation-export-btn:hover:not( :disabled ) { border-color: rgba( 0, 0, 0, 0.45 ); }
.clew-conversation-export-btn:disabled { opacity: 0.4; cursor: default; }

.clew-conversation-export {
	padding: 12px 16px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	background: rgba( 0, 0, 0, 0.02 );
}

/* ---- Save to memory chooser (8.4.14): the panel under the
   thread header on a dual or group thread — one checkbox
   per person in the conversation. ---- */
.clew-conversation-save-memory {
	padding: 12px 16px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	background: rgba( 0, 0, 0, 0.02 );
}

.clew-conversation-save-memory-title {
	margin: 0 0 8px;
	font-weight: 600;
}

.clew-conversation-save-memory label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 16px 8px 0;
	cursor: pointer;
}

.clew-conversation-save-memory-actions {
	display: flex;
	gap: 8px;
	margin-top: 4px;
}

.clew-conversation-export-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 12.5px;
	margin-bottom: 8px;
}

.clew-conversation-export-controls label {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.clew-conversation-export-controls select { padding: 3px 6px; }

.clew-conversation-export-close {
	margin-left: auto;
	background: none;
	border: 0;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.5;
	color: inherit;
}

.clew-conversation-export-close:hover { opacity: 1; }

.clew-conversation-export-text {
	width: 100%;
	resize: vertical;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	line-height: 1.5;
	padding: 10px;
	border: 1px solid rgba( 0, 0, 0, 0.18 );
	border-radius: 6px;
	background: #fff;
	/* Wrapping is deliberate: this is a preview to eyeball before
	   copying, not an editor where horizontal scroll would be useful. */
	white-space: pre-wrap;
}

.clew-conversation-export-note {
	font-size: 11.5px;
	opacity: 0.65;
	margin: 6px 0 0;
	min-height: 14px;
}

.clew-conversation-export-controls label.is-disabled {
	opacity: 0.4;
	cursor: default;
}

.clew-conversation-truncated {
	font-size: 11.5px;
	opacity: 0.6;
	font-style: italic;
	text-align: center;
	margin: 0 0 10px;
	padding: 7px 10px;
	border-bottom: 1px dashed rgba( 0, 0, 0, 0.12 );
}

.clew-conversation-repair {
	border: 1px solid rgba( 200, 120, 0, 0.35 );
	background: rgba( 240, 180, 41, 0.08 );
	border-radius: 8px;
	padding: 12px 14px;
	margin: 12px 0;
	font-size: 12.5px;
}

.clew-conversation-repair p { margin: 0 0 7px; }
.clew-conversation-repair-hint { opacity: 0.75; font-size: 11.5px; }

/* ==================================================================
   Flickella Chat (8.3.31) — [flickella] shortcode
   A mirror of the Conversations window above: the template and the
   player use the .clew-conversation-* structure and classes as-is,
   so there is deliberately almost nothing here. What remains is only
   what Flickella adds on top of that structure: the slide-number
   chip on a slide message's row, and the slide image sizing inside
   the user bubble (the conversation's attached-image class already
   handles display; a slide photo is capped like a stage photo).
   The old dark-stage .flickella-* design (8.3.26–8.3.30) is gone.
   ================================================================== */
.flickella-slide-num {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #2a5bd7;
	color: #fff;
	font-family: Georgia, 'Times New Roman', serif;
	font-weight: 700;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
}

.clew-conversation-msg-user .clew-conversation-attached-img {
	max-height: 280px;
	width: auto;
	max-width: 100%;
	object-fit: cover;
}

/* ==================================================================
   Live Avatar (8.3.63, Anam Path A; dock layout 8.3.64)
   The rail block shows the open character's portrait as a still
   frame; Start swaps it for the live video. While she is live the
   frame moves into the dock panel on the right-hand side of the
   conversation window (the node itself moves — nothing is copied
   — so a live session keeps running while the layout changes),
   and when she stops the panel is gone entirely and the frame
   moves back to the rail. The [hidden] guards matter: these
   elements carry the hidden attribute, and an author display rule
   would otherwise beat it.
   ================================================================== */
.clew-conversation-rail-section-avatar {
	background: rgba( 30, 41, 59, 0.07 );
}
.clew-conversation-avatar-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #0f172a;
	border-radius: 8px;
	overflow: hidden;
	margin: 8px 0;
}
.clew-conversation-avatar-still {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.clew-conversation-avatar-still[hidden] {
	display: none;
}
.clew-conversation-avatar-still img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.clew-conversation-avatar-still .clew-conversation-rail-portrait-placeholder {
	font-size: 48px;
	color: rgba( 255, 255, 255, 0.55);
}
.clew-conversation-avatar-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: #0f172a;
}
.clew-conversation-avatar-video[hidden] {
	display: none;
}
/* Tavus (8.3.65): the conversation rides in an iframe inside
   the same avatar frame, so it fills the dock exactly like the
   Anam video does. */
.clew-conversation-avatar-tavus {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #0f172a;
}
/* A spoken message (dictated to the avatar) reads as said, not typed. */
.clew-conversation-msg-user.is-spoken .clew-conversation-bubble::before {
	content: '\1F399\FE0F ';
}

/* ---- Live Avatar dock (8.3.64) ----
   While she is live, the video docks on the right-hand side of
   the conversation window — a dark panel with the video large on
   top, the status line, and Stop / mic mute / full-screen /
   close controls under it. The panel is a flex sibling of the
   thread column; when it is hidden the chat takes the full width
   again — no empty space, no dead frame. */
.clew-conversation-dock {
	flex: 0 0 38%;
	width: 38%;
	min-width: 0;
	border-left: 1px solid rgba( 0, 0, 0, 0.1 );
	background: #0b1220;
	color: #e5e7eb;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	box-sizing: border-box;
}
.clew-conversation-dock[hidden] {
	display: none;
}
.clew-conversation-dock-status {
	font-size: 12px;
	opacity: 0.75;
}
.clew-conversation-dock-status.is-error {
	color: #fca5a5;
	opacity: 1;
}
.clew-conversation-dock-video {
	flex: 0 0 auto;
	display: flex;
}
.clew-conversation-dock-video .clew-conversation-avatar-frame {
	flex: 1;
	aspect-ratio: 16 / 9;
	margin: 0;
}
.clew-conversation-dock-controls {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.clew-conversation-dock .clew-conversation-btn-ghost {
	color: #e5e7eb;
	border-color: rgba( 255, 255, 255, 0.35 );
}
/* Full screen runs on the dock panel itself: it fills the
   screen, the video grows with it, and leaving full screen
   leaves the session live and docked. */
.clew-conversation-dock:fullscreen {
	width: 100%;
}
.clew-conversation-dock:fullscreen .clew-conversation-dock-video {
	flex: 1 1 auto;
	min-height: 0;
}
.clew-conversation-dock:fullscreen .clew-conversation-dock-video .clew-conversation-avatar-frame {
	aspect-ratio: auto;
}

/* ==================================================================
   Chat Video (8.3.68) — the Conversations window redesigned on
   Jack's two 'Chat Video' mockups. Video open: the live face is
   the window's main column and the chat narrows to a panel on its
   right. Video closed: a Chats list sits on the left and the
   thread on the right. The control bar (Paperclip, Camera,
   Microphone, Autosight, Talk) sits under the chat in both
   states. No picture-in-picture anywhere — the stage IS the
   video. Only the layout changed here: Autosight, Talk, the
   avatar and every rail feature work exactly as before.
   8.3.69 reworks video open to two columns (rail ~25% left,
   main column stacks the video over a small transcript) and
   fixes the 8.3.68 live rules, which never fired because the
   template root never carried the `clew-conversation-root`
   class they were written against — that is why 8.3.68 opened
   as three columns on the live install.
   ================================================================== */

/* ---- Window header bar ---- */
.clew-conversation-video-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	font-weight: 700;
}
.clew-conversation-video-sparkle {
	color: #2a5bd7;
	font-size: 16px;
}
.clew-conversation-video-title {
	font-size: 15px;
}
.clew-conversation-video-connected {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #15803d;
	background: rgba( 22, 163, 74, 0.1 );
	border-radius: 999px;
	padding: 3px 10px;
}
.clew-conversation-video-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #16a34a;
}

/* ---- Chats list: search, then one row per thread ---- */
.clew-conversation-chats-search {
	margin-bottom: 8px;
}
.clew-conversation-chats-search input[type="search"] {
	width: 100%;
	padding: 7px 10px;
	border-radius: 8px;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
	font-size: 13px;
	box-sizing: border-box;
}
/* The rows sit in a capped-height scrolling window under the
   search box (8.3.70), so a long history scrolls inside its own
   window instead of pushing the setup sections down the rail. */
.clew-conversation-chats-list-scroll {
	max-height: 320px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
/* One row per thread: portrait, then a text column whose first
   line is the title at full width, the agent name + time on the
   meta line under it, and the last-message preview below that.
   The time used to sit beside the text column as its own flex
   child and win the width, truncating the title to a stub. The
   text column is min-width: 0 so the preview truncates to one
   line instead of widening the rail — the web twin caught rows
   sizing to untruncated content (597px in a 280px rail). */
.clew-conversation-rail-section-chats .clew-conversation-list-row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

/* 8.3.92: the actions line up under the title text, past the
   portrait — 36px portrait + 10px gap + 8px button padding. */
.clew-conversation-rail-section-chats .clew-conversation-row-actions {
	padding-left: 54px;
}
.clew-conversation-rail-section-chats .clew-conversation-list-item {
	flex-direction: row;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1 1 auto;
}
.clew-conversation-list-avatar {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	overflow: hidden;
	background: #dbe2f2;
	color: #2a5bd7;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
}
.clew-conversation-list-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.clew-conversation-list-text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.clew-conversation-list-preview {
	font-size: 12px;
	opacity: 0.65;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* Title line one, agent + time on the meta line under it
   (8.3.70): the agent name truncates if it must, the time never
   does — it is the short form, the full date lives in the row's
   hover title. */
.clew-conversation-list-meta {
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 11px;
	opacity: 0.65;
}
.clew-conversation-list-agent {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}
.clew-conversation-rail-section-chats .clew-conversation-list-time {
	flex: 0 0 auto;
}

/* ---- Thread header: identity + tools on one row, the
   story / status / buttons sub-row under it. The header wraps,
   so the sub-row takes a full second line of its own. ---- */
.clew-conversation-thread-header {
	flex-wrap: wrap;
	row-gap: 6px;
}
.clew-conversation-thread-identity {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1 1 auto;
}
.clew-conversation-thread-avatar {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	background: #dbe2f2;
	color: #2a5bd7;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 700;
}
.clew-conversation-thread-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.clew-conversation-thread-names {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.clew-conversation-with {
	font-weight: 700;
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.clew-conversation-presence {
	font-size: 12px;
	font-weight: 500;
	opacity: 0.65;
}
.clew-conversation-thread-tools {
	display: flex;
	gap: 2px;
	margin-left: auto;
}
.clew-conversation-header-icon {
	width: 34px;
	height: 34px;
	border: 0;
	background: transparent;
	border-radius: 50%;
	cursor: pointer;
	font-size: 17px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.clew-conversation-header-icon:hover {
	background: rgba( 0, 0, 0, 0.06 );
}
.clew-conversation-header-icon:disabled {
	opacity: 0.35;
	cursor: default;
}
.clew-conversation-header-icon.is-on {
	background: rgba( 42, 91, 215, 0.12 );
	color: #2a5bd7;
}
.clew-conversation-thread-sub {
	flex: 1 1 100%;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
/* The old single-row header pushed the status right with an auto
   margin; the sub-row has its own spacer for that now. */
.clew-conversation-thread-sub .clew-conversation-status {
	margin-left: 0;
}
.clew-conversation-thread-sub-spacer {
	flex: 1 1 auto;
}

/* ---- Date dividers: one pill per day on the thread agent's clock ---- */
.clew-conversation-date-divider {
	display: flex;
	justify-content: center;
	margin: 6px 0 2px;
}
.clew-conversation-date-divider span {
	font-size: 11px;
	font-weight: 600;
	color: rgba( 0, 0, 0, 0.55 );
	background: rgba( 0, 0, 0, 0.05 );
	border-radius: 999px;
	padding: 3px 10px;
}

/* ---- Composer: one row — paperclip, text, dictation mic, round blue send ---- */
.clew-conversation-composer-input {
	align-items: center;
}
.clew-conversation-composer-input .clew-conversation-attach-btn {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 50%;
	align-self: center;
}
.clew-conversation-composer-input .clew-conversation-attach-btn:hover {
	background: rgba( 0, 0, 0, 0.06 );
}

/* ---- API sphere (8.3.82): the small sphere left of the composer input — it wears the colour of the API driving this conversation (the active preset's colour, else the built-in default's provider colour). A ring means a preset is in use. The colour arrives as a CSS variable set from the server payload; the gradient reads as a sphere, not a flat dot. ---- */
.clew-conversation-api-sphere {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	align-self: center;
	background: radial-gradient( circle at 35% 30%, color-mix( in srgb, var( --clew-api-sphere-color, #808080 ) 55%, white ), var( --clew-api-sphere-color, #808080 ) 55%, color-mix( in srgb, var( --clew-api-sphere-color, #808080 ) 60%, black ) );
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.25 );
}
.clew-conversation-api-sphere.is-preset {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var( --clew-api-sphere-color, #808080 ), 0 1px 2px rgba( 0, 0, 0, 0.25 );
}
.clew-conversation-mic-btn {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	border-radius: 50%;
	cursor: pointer;
	font-size: 17px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	padding: 0;
}
.clew-conversation-mic-btn:hover {
	background: rgba( 0, 0, 0, 0.06 );
}
.clew-conversation-mic-btn.is-on {
	background: rgba( 42, 91, 215, 0.12 );
	color: #2a5bd7;
}
.clew-conversation-send-btn {
	width: 42px;
	height: 42px;
	min-height: 42px;
	padding: 0;
	border-radius: 50%;
	align-self: center;
	font-size: 16px;
}

/* ---- Control bar: the five tools under the chat ---- */
.clew-conversation-bar {
	display: flex;
	gap: 6px;
	padding: 10px 12px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	flex-wrap: wrap;
}
.clew-conversation-bar-btn {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 8px 4px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	cursor: pointer;
	font-size: 12px;
	color: inherit;
}
.clew-conversation-bar-btn:hover {
	background: rgba( 0, 0, 0, 0.05 );
}
.clew-conversation-bar-btn:disabled {
	opacity: 0.35;
	cursor: default;
}
.clew-conversation-bar-btn.is-on {
	background: rgba( 42, 91, 215, 0.12 );
	color: #2a5bd7;
}

/* 8.4.12: the bar Microphone while dictating — red, like the
   composer's recording state. */
.clew-conversation-bar-btn.is-recording {
	background: rgba( 179, 45, 46, 0.08 );
	color: #b32d2e;
}
.clew-conversation-bar-icon {
	font-size: 18px;
	line-height: 1;
}
.clew-conversation-bar-label {
	font-size: 11px;
	font-weight: 600;
}
.clew-conversation-bar-note {
	margin: 0;
	padding: 0 12px 10px;
	font-size: 12px;
	color: rgba( 0, 0, 0, 0.65 );
}
.clew-conversation-bar-note.is-error {
	color: #b32d2e;
}
.clew-conversation-bar-note[hidden] {
	display: none;
}

/* ---- Stage overlays: LIVE badge, name label, speaker /
   full-screen / settings icons over the video ---- */
.clew-conversation-dock-video {
	position: relative;
}
.clew-conversation-stage-live {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #dc2626;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	border-radius: 4px;
	padding: 3px 8px;
}
.clew-conversation-stage-live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #fff;
}

/* ---- Layout preview (8.3.69): the same stage, clearly labelled
   — an amber Preview badge instead of the red LIVE badge, shown
   when the open persona has no live avatar configured and the
   player opens the layout to look at it. No session runs. The
   [hidden] rules are needed because the badge classes set
   display themselves, which beats the UA [hidden] rule. ---- */
.clew-conversation-stage-preview {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #d97706;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	border-radius: 4px;
	padding: 3px 8px;
}
.clew-conversation-stage-live[hidden],
.clew-conversation-stage-preview[hidden] {
	display: none;
}
.clew-conversation-stage-name {
	position: absolute;
	left: 12px;
	bottom: 12px;
	z-index: 3;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-shadow: 0 1px 4px rgba( 0, 0, 0, 0.6 );
}
.clew-conversation-stage-icons {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: flex;
	gap: 4px;
}
.clew-conversation-stage-icon {
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.45 );
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.clew-conversation-stage-icon:hover {
	background: rgba( 0, 0, 0, 0.65 );
}
.clew-conversation-stage-icon:disabled {
	opacity: 0.4;
	cursor: default;
}
.clew-conversation-stage-icon.is-on {
	background: rgba( 42, 91, 215, 0.85 );
}

/* ---- Live stage, two columns (8.3.69) ----
   Jack's report on 8.3.68: opening the video made THREE columns
   and the video filled the right one. The cause was here in the
   stylesheet, not in the markup: every live rule was written as
   `.clew-conversation-root.is-avatar-live …`, but the template
   root never carried the `clew-conversation-root` class, so none
   of those rules ever matched and the dock fell back to its base
   38% flex width as a third column. The template now carries the
   class, and the layout is the two columns Jack drew: the rail
   stays visible at ~25% on the left, and the main column (~75%)
   stacks — the dock (video) fills the top 50–60% of the thread
   column, and below it the header, a SMALL scrolling transcript,
   the composer and the control bar. The transcript's inline px
   height is overridden here so it shrinks to the small window
   while live; stopping the video removes the stage and the chat
   fills the main column again, as before. ---- */
.clew-conversation-root.is-avatar-live .clew-conversation-rail {
	display: block;
	flex: 0 0 25%;
	width: 25%;
	max-width: 320px;
}
.clew-conversation-root.is-avatar-live .clew-conversation-thread {
	flex: 1 1 auto;
	height: 84vh;
	min-height: 0;
}
.clew-conversation-root.is-avatar-live .clew-conversation-dock {
	flex: 0 0 56%;
	width: auto;
	min-width: 0;
	border: 0;
	border-bottom: 1px solid rgba( 255, 255, 255, 0.12 );
	padding: 0;
}
.clew-conversation-root.is-avatar-live .clew-conversation-dock-controls {
	padding: 0 14px 12px;
}
.clew-conversation-root.is-avatar-live .clew-conversation-dock-video {
	flex: 1 1 auto;
	min-height: 0;
}
.clew-conversation-root.is-avatar-live .clew-conversation-dock-video .clew-conversation-avatar-frame {
	aspect-ratio: auto;
	height: 100%;
}
.clew-conversation-root.is-avatar-live .clew-conversation-transcript {
	height: auto !important;
	flex: 1 1 auto;
	min-height: 120px;
}

/* ---- Chat tools (8.3.69): ••• folds the setup panels in place
   (the Chats list stays put) in BOTH states now — the rail never
   leaves the layout while the video is live, so the right-hand
   overlay is gone. The Live Avatar block never unmounts — it is
   only hidden or moved, never destroyed. The tools head is a
   plain row at the top of the rail holding the manual camera
   button, always reachable. ---- */
.clew-conversation-tools-head {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 12px;
}
.clew-conversation-root.clew-rail-folded .clew-conversation-rail-section:not(.clew-conversation-rail-section-chats) {
	display: none;
}

/* ---- Narrow (8.3.69): the body already stacks (rail on top,
   thread below, dock at the thread's top) — the live column just
   gives up its fixed 84vh height, the stage takes its natural
   16:9 height, and the transcript keeps its normal px height. ---- */
@media ( max-width: 782px ) {
	.clew-conversation-root.is-avatar-live .clew-conversation-rail {
		flex: 1 1 auto;
		width: auto;
		max-width: none;
	}
	.clew-conversation-root.is-avatar-live .clew-conversation-thread {
		flex: 1 1 auto;
		height: auto;
		max-width: none;
	}
	.clew-conversation-root.is-avatar-live .clew-conversation-dock {
		flex: 0 0 auto;
	}
	.clew-conversation-root.is-avatar-live .clew-conversation-dock-video {
		min-height: 280px;
	}
}
