/* ============================================================
   ListKr — modules stylesheet (chat + categories)
   Self-contained: uses hardcoded ListKr palette values so it
   renders identically on every page. Existing page styles and
   layout are never overridden.
   ============================================================ */
.tx-scope {
	--tx-surface: #f9f9ff;
	--tx-on-surface: #141b2b;
	--tx-on-surface-variant: #434654;
	--tx-primary: #003fb1;
	--tx-primary-container: #1a56db;
	--tx-on-primary: #ffffff;
	--tx-secondary: #006c49;
	--tx-secondary-container: #7ef6be;
	--tx-error: #ba1a1a;
	--tx-outline: #737686;
	--tx-outline-variant: #c3c5d7;
	--tx-container: #e9edff;
	--tx-container-low: #f1f3ff;
	--tx-inverse: #293040;
	font-family: "Hanken Grotesk", "Inter", system-ui, -apple-system, sans-serif;
	box-sizing: border-box;
}
.tx-scope *,
.tx-scope *::before,
.tx-scope *::after {
	box-sizing: border-box;
}

.tx-icon {
	font-family: "Material Symbols Outlined";
	font-weight: normal;
	font-style: normal;
	font-size: 20px;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	display: inline-block;
	white-space: nowrap;
	direction: ltr;
	-webkit-font-feature-settings: "liga";
	-webkit-font-smoothing: antialiased;
	flex-shrink: 0;
}
.tx-hidden {
	display: none !important;
}

/* ============================================================
   Categories — dropdown panel
   ============================================================ */
.tx-cat-panel {
	position: fixed;
	z-index: 9000;
	width: 320px;
	max-height: 70vh;
	overflow-y: auto;
	padding: 8px;
	background: #ffffff;
	border: 1px solid var(--tx-outline-variant);
	border-radius: 14px;
	box-shadow: 0 18px 44px rgba(20, 27, 43, 0.16);
	animation: tx-pop 0.14s ease-out;
}
@keyframes tx-pop {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}
.tx-cat-panel__label {
	padding: 6px 10px 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--tx-outline);
}
.tx-cat-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 10px;
	text-decoration: none;
	color: var(--tx-on-surface);
	font-size: 14px;
	transition: background 0.15s ease, color 0.15s ease;
}
.tx-cat-item:hover {
	background: var(--tx-container-low);
}
.tx-cat-item[aria-current="true"] {
	background: var(--tx-container);
	color: var(--tx-primary);
	font-weight: 600;
}
.tx-cat-item__left {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.tx-cat-item__left .tx-icon {
	color: var(--tx-primary);
}
.tx-cat-item__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tx-cat-item__count {
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 600;
	color: var(--tx-outline);
}

/* ============================================================
   Categories — chip row + banner on /browse
   ============================================================ */
.tx-cat-row {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 0 12px;
	scrollbar-width: thin;
}
.tx-cat-row::-webkit-scrollbar {
	height: 6px;
}
.tx-cat-row::-webkit-scrollbar-thumb {
	background: var(--tx-outline-variant);
	border-radius: 99px;
}
.tx-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	padding: 8px 14px;
	border: 1px solid var(--tx-outline-variant);
	border-radius: 999px;
	background: #ffffff;
	color: var(--tx-on-surface-variant);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: all 0.15s ease;
}
.tx-chip .tx-icon {
	font-size: 18px;
}
.tx-chip:hover {
	border-color: var(--tx-primary);
	color: var(--tx-primary);
	background: var(--tx-container-low);
}
.tx-chip[aria-current="true"] {
	background: var(--tx-primary);
	border-color: var(--tx-primary);
	color: var(--tx-on-primary);
	font-weight: 600;
}
.tx-chip__count {
	font-size: 11px;
	font-weight: 700;
	opacity: 0.75;
}
.tx-cat-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
	padding: 10px 14px;
	border: 1px solid var(--tx-outline-variant);
	border-radius: 10px;
	background: var(--tx-container-low);
	color: var(--tx-on-surface-variant);
	font-size: 13px;
}
.tx-cat-banner strong {
	color: var(--tx-on-surface);
}
.tx-cat-banner__clear {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--tx-primary);
	font-weight: 600;
	text-decoration: none;
}
.tx-cat-banner__clear .tx-icon {
	font-size: 16px;
}
.tx-cat-banner__clear:hover {
	text-decoration: underline;
}
.tx-empty {
	grid-column: 1 / -1;
	margin: 8px 0 24px;
	padding: 34px 20px;
	text-align: center;
	border: 1px dashed var(--tx-outline-variant);
	border-radius: 14px;
	background: var(--tx-container-low);
	color: var(--tx-on-surface-variant);
	font-size: 14px;
}
.tx-empty .tx-icon {
	display: block;
	margin: 0 auto 8px;
	font-size: 34px;
	color: var(--tx-outline);
}

/* ============================================================
   Chat — triggers
   ============================================================ */
.tx-chat-trigger {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-right: 2px;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--tx-on-surface-variant);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.tx-chat-trigger:hover {
	background: var(--tx-container);
	color: var(--tx-primary);
}
.tx-badge,
.tx-chat-fab__badge {
	position: absolute;
	top: 4px;
	right: 4px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--tx-error);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}
.tx-chat-fab {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 8500;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 20px;
	border: none;
	border-radius: 999px;
	background: var(--tx-primary);
	color: var(--tx-on-primary);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 12px 30px rgba(0, 63, 177, 0.34);
	transition: transform 0.15s ease, background 0.15s ease;
}
.tx-chat-fab:hover {
	background: var(--tx-primary-container);
	transform: translateY(-2px);
}
.tx-chat-fab__badge {
	position: static;
	background: var(--tx-secondary-container);
	color: #00352a;
}

/* ============================================================
   Chat — drawer
   ============================================================ */
.tx-chat-overlay {
	position: fixed;
	inset: 0;
	z-index: 9500;
	display: flex;
	justify-content: flex-end;
	background: rgba(20, 27, 43, 0.45);
	backdrop-filter: blur(2px);
	animation: tx-fade 0.16s ease-out;
}
@keyframes tx-fade {
	from {
		opacity: 0;
	}
}
.tx-chat {
	display: flex;
	flex-direction: column;
	width: min(880px, 100%);
	height: 100%;
	background: var(--tx-surface);
	box-shadow: -14px 0 40px rgba(20, 27, 43, 0.28);
	animation: tx-slide 0.2s ease-out;
}
@keyframes tx-slide {
	from {
		transform: translateX(30px);
		opacity: 0.4;
	}
}
.tx-chat__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	background: var(--tx-inverse);
	color: #ffffff;
	flex-shrink: 0;
}
.tx-chat__top-left {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.tx-dot {
	width: 9px;
	height: 9px;
	border-radius: 999px;
	background: #22c55e;
	box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
	flex-shrink: 0;
}
.tx-chat__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
}
.tx-chat__sub {
	display: flex;
	align-items: center;
	gap: 5px;
	margin: 2px 0 0;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 11px;
	color: #a9b1c6;
}
.tx-chat__sub .tx-icon {
	font-size: 13px;
}
.tx-chat__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	cursor: pointer;
}
.tx-chat__close:hover {
	background: rgba(255, 255, 255, 0.2);
}
.tx-chat__body {
	display: flex;
	flex: 1;
	min-height: 0;
}

/* thread list */
.tx-threads {
	width: 268px;
	flex-shrink: 0;
	overflow-y: auto;
	padding: 10px;
	border-right: 1px solid var(--tx-outline-variant);
	background: var(--tx-container-low);
}
.tx-threads__label {
	padding: 4px 8px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--tx-outline);
}
.tx-thread {
	display: flex;
	gap: 10px;
	width: 100%;
	margin-bottom: 6px;
	padding: 9px;
	border: 1px solid transparent;
	border-radius: 12px;
	background: transparent;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.tx-thread:hover {
	background: #ffffff;
}
.tx-thread[aria-current="true"] {
	background: #ffffff;
	border-color: var(--tx-primary);
}
.tx-thread__img {
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	border-radius: 9px;
	object-fit: cover;
	background: var(--tx-container);
}
.tx-thread__main {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1;
}
.tx-thread__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
}
.tx-thread__name {
	font-size: 13px;
	font-weight: 700;
	color: var(--tx-on-surface);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tx-thread__unread {
	flex-shrink: 0;
	min-width: 17px;
	height: 17px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--tx-error);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}
.tx-thread__price {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 11px;
	font-weight: 600;
	color: var(--tx-primary);
}
.tx-thread__last {
	font-size: 11px;
	color: var(--tx-outline);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* conversation */
.tx-convo {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}
.tx-convo--empty {
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	color: var(--tx-outline);
	font-size: 14px;
}
.tx-convo__deal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 12px 16px;
	border-bottom: 1px solid var(--tx-outline-variant);
	background: #ffffff;
}
.tx-convo__deal-left {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.tx-convo__img {
	width: 44px;
	height: 44px;
	border-radius: 9px;
	object-fit: cover;
	background: var(--tx-container);
}
.tx-convo__title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--tx-on-surface);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tx-convo__price {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 12px;
	font-weight: 700;
	color: var(--tx-primary);
}
.tx-escrow-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 11px;
	border-radius: 999px;
	background: var(--tx-secondary-container);
	color: #00352a;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.03em;
}
.tx-escrow-tag .tx-icon {
	font-size: 15px;
}
.tx-fingerprint {
	padding: 6px 16px;
	background: var(--tx-inverse);
	color: #8ff0c0;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 10px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tx-messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: var(--tx-surface);
}
.tx-notice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 9px 12px;
	border: 1px solid #fcd34d;
	border-radius: 10px;
	background: #fffbeb;
	color: #92400e;
	font-size: 12px;
	line-height: 1.45;
}
.tx-notice .tx-icon {
	font-size: 16px;
}
.tx-msg {
	display: flex;
	flex-direction: column;
	max-width: 74%;
}
.tx-msg--out {
	align-self: flex-end;
	align-items: flex-end;
}
.tx-msg--in {
	align-self: flex-start;
	align-items: flex-start;
}
.tx-msg__who {
	margin-bottom: 3px;
	padding: 0 4px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tx-outline);
}
.tx-bubble {
	padding: 10px 14px;
	font-size: 13px;
	line-height: 1.5;
	word-break: break-word;
}
.tx-msg--out .tx-bubble {
	border-radius: 14px 14px 4px 14px;
	background: var(--tx-primary);
	color: var(--tx-on-primary);
}
.tx-msg--in .tx-bubble {
	border: 1px solid var(--tx-outline-variant);
	border-radius: 14px 14px 14px 4px;
	background: #ffffff;
	color: var(--tx-on-surface);
}
.tx-msg__meta {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 4px;
	padding: 0 4px;
	font-size: 10px;
	color: var(--tx-outline);
}
.tx-msg__meta .tx-icon {
	font-size: 13px;
}
.tx-icon--read {
	color: var(--tx-primary);
}
.tx-icon--lock {
	color: var(--tx-secondary);
}
.tx-sys {
	align-self: center;
	max-width: 88%;
	padding: 10px 14px;
	border: 1px solid var(--tx-secondary-container);
	border-radius: 12px;
	background: #effdf6;
	text-align: center;
}
.tx-sys__head {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-bottom: 4px;
	color: var(--tx-secondary);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.tx-sys__head .tx-icon {
	font-size: 15px;
}
.tx-sys__text {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: #14432f;
}
.tx-sys__time {
	display: block;
	margin-top: 4px;
	font-size: 10px;
	color: var(--tx-outline);
}
.tx-composer {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
	padding: 12px 16px;
	border-top: 1px solid var(--tx-outline-variant);
	background: #ffffff;
}
.tx-composer__input {
	flex: 1;
	min-width: 0;
	padding: 11px 14px;
	border: 1px solid var(--tx-outline-variant);
	border-radius: 999px;
	background: var(--tx-container-low);
	color: var(--tx-on-surface);
	font-size: 13px;
	font-family: inherit;
	outline: none;
}
.tx-composer__input:focus {
	border-color: var(--tx-primary);
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(0, 63, 177, 0.12);
}
.tx-composer__send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border: none;
	border-radius: 999px;
	background: var(--tx-primary);
	color: var(--tx-on-primary);
	cursor: pointer;
	transition: background 0.15s ease;
}
.tx-composer__send:hover {
	background: var(--tx-primary-container);
}

/* toast */
.tx-toast {
	position: fixed;
	left: 50%;
	bottom: 88px;
	z-index: 9600;
	transform: translateX(-50%);
	padding: 11px 18px;
	border-radius: 999px;
	background: var(--tx-inverse);
	color: #ffffff;
	font-size: 13px;
	box-shadow: 0 10px 26px rgba(20, 27, 43, 0.3);
	animation: tx-fade 0.18s ease-out;
}

/* responsive */
@media (max-width: 720px) {
	.tx-threads {
		width: 104px;
	}
	.tx-threads__label,
	.tx-thread__last,
	.tx-thread__price {
		display: none;
	}
	.tx-thread {
		flex-direction: column;
		align-items: center;
	}
	.tx-chat-fab span:not(.tx-chat-fab__badge) {
		display: none;
	}
	.tx-chat-fab {
		padding: 14px;
	}
	.tx-msg {
		max-width: 90%;
	}
}

/* ===== v6: dropdown, filter chips, drawer, empty state ===== */
.tx-hidden { display: none !important; }
.tx-dd {
	z-index: 60;
	width: 20rem;
	max-height: 26rem;
	overflow-y: auto;
	background: #ffffff;
	border: 1px solid #c3c5d7;
	border-radius: 16px;
	box-shadow: 0 18px 40px rgba(20, 27, 43, 0.16);
	padding: 8px;
}
.tx-dd__label {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #737686;
	padding: 8px 10px 4px;
}
.tx-dd__list { list-style: none; margin: 0; padding: 0; }
.tx-dd__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	color: #141b2b;
	text-decoration: none;
	font-size: 14px;
	transition: background 0.15s ease, color 0.15s ease;
}
.tx-dd__item:hover { background: #e9edff; color: #003fb1; }
.tx-dd__item[aria-current="true"] { background: #f1f3ff; color: #003fb1; font-weight: 700; }
.tx-dd__left { display: flex; align-items: center; gap: 10px; }
.tx-dd__count { font-size: 12px; color: #737686; }
.tx-chipbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.tx-fchip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid #c3c5d7;
	background: #f1f3ff;
	color: #003fb1;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}
.tx-fchip:hover { background: #e9edff; border-color: #003fb1; }
.tx-fchip .tx-icon { font-size: 14px; }
.tx-fchip--clear { background: #ffffff; color: #ba1a1a; border-color: #ba1a1a33; }
.tx-empty {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 28px;
	margin-top: 16px;
	border: 1px dashed #c3c5d7;
	border-radius: 16px;
	background: #f9f9ff;
	color: #434654;
}
.tx-empty .tx-icon { font-size: 30px; color: #737686; }
.tx-empty p { margin: 4px 0 0; font-size: 13px; color: #737686; }
@media (max-width: 767px) {
	aside.tx-drawer-open {
		display: block !important;
		position: fixed;
		inset: 0;
		z-index: 70;
		background: rgba(20, 27, 43, 0.45);
		padding: 0;
		overflow-y: auto;
	}
	aside.tx-drawer-open > * {
		background: #ffffff;
		border-radius: 20px 20px 0 0;
		margin-top: 12vh;
		padding: 16px;
		min-height: 88vh;
	}
	body.tx-drawer-lock { overflow: hidden; }
}
