widget[type="codex-chats"] {
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
	background: #202020;
}

widget[type="codex-chats"] codex-chats-header {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.45rem 0.6rem;
	border-bottom: 1px solid var(--border);
	background: var(--bg-chrome);
}

widget[type="codex-chats"] codex-chats-title {
	color: var(--fg-em);
	font-weight: 600;
}

widget[type="codex-chats"] codex-chats-status {
	color: var(--fg-dim);
	font-size: 0.8rem;
}

widget[type="codex-chats"] codex-chats-settings {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	gap: 0.35rem;
	align-items: center;
	justify-content: flex-end;
}

widget[type="codex-chats"] codex-chats-settings select {
	min-width: 6.5rem;
	max-width: 12rem;
	padding: 0.18rem 0.35rem;
	background: var(--bg);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 2px;
	font: inherit;
	font-size: 0.76rem;
}

widget[type="codex-chats"] codex-chats-settings select:last-child {
	min-width: 8rem;
}

widget[type="codex-chats"] codex-chats-header button,
widget[type="codex-chats"] codex-chats-row-actions button,
widget[type="codex-chats"] codex-chats-detail-toolbar button {
	padding: 0.2rem 0.55rem;
	background: var(--bg-elev);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 2px;
	font: inherit;
	font-size: 0.78rem;
	cursor: pointer;
}

widget[type="codex-chats"] codex-chats-header button:disabled,
widget[type="codex-chats"] codex-chats-row-actions button:disabled,
widget[type="codex-chats"] codex-chats-detail-toolbar button:disabled {
	cursor: default;
	opacity: 0.6;
}

widget[type="codex-chats"] button:active,
widget[type="codex-chats"] button[busy] {
	transform: translateY(1px);
	background: var(--workspace-accent);
	color: var(--workspace-on-accent);
}

widget[type="codex-chats"] codex-chats-body {
	display: block;
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 0.5rem;
}

widget[type="codex-chats"] codex-chats-section {
	display: block;
	margin-bottom: 0.75rem;
}

widget[type="codex-chats"] codex-chats-section-title {
	display: block;
	margin-bottom: 0.35rem;
	color: var(--fg-dim);
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
}

widget[type="codex-chats"] codex-chats-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.5rem;
	border-bottom: 1px solid var(--border);
}

widget[type="codex-chats"] codex-chats-row[role="button"] {
	cursor: pointer;
}

widget[type="codex-chats"] codex-chats-row[role="button"]:hover {
	background: var(--bg-elev);
}

widget[type="codex-chats"] codex-chats-row[role="button"]:focus {
	outline: 1px solid var(--workspace-accent);
	outline-offset: -1px;
}

widget[type="codex-chats"] codex-chats-row-main {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
}

widget[type="codex-chats"] codex-chats-row-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
}

widget[type="codex-chats"] codex-chats-row-actions button {
	font-size: 0.72rem;
}

widget[type="codex-chats"] codex-chats-row-title {
	display: block;
	color: var(--fg-em);
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

widget[type="codex-chats"] codex-chats-row-meta,
widget[type="codex-chats"] codex-chats-empty-row {
	display: block;
	margin-top: 0.18rem;
	color: var(--fg-dim);
	font-family: var(--font-mono);
	font-size: 0.75rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

widget[type="codex-chats"] codex-chats-empty-detail {
	display: block;
	margin-top: 0.18rem;
	color: var(--fg-dim);
	font-family: var(--font-mono);
	font-size: 0.75rem;
	overflow-wrap: anywhere;
	white-space: normal;
}

widget[type="codex-chats"] codex-chats-empty {
	display: block;
	padding: 0.6rem;
	border-left: 3px solid var(--workspace-accent);
	background: var(--bg-elev);
}

widget[type="codex-chats"] codex-chats-inline-error {
	display: block;
	margin-bottom: 0.6rem;
	padding: 0.45rem 0.5rem;
	color: var(--fg-error);
	background: var(--bg-error);
}

widget[type="codex-chats"] codex-chats-empty-title {
	display: block;
	color: var(--fg-em);
	font-weight: 600;
}

widget[type="codex-chats"] codex-chats-detail {
	display: block;
}

widget[type="codex-chats"] codex-chats-detail-toolbar {
	position: sticky;
	top: -0.5rem;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: -0.5rem -0.5rem 0.75rem;
	padding: 0.5rem;
	border-bottom: 1px solid var(--border);
	background: var(--bg-chrome);
}

widget[type="codex-chats"] codex-chats-detail-heading {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
}

widget[type="codex-chats"] codex-chats-detail-title {
	display: block;
	color: var(--fg-em);
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

widget[type="codex-chats"] codex-chats-detail-subtitle {
	display: block;
	margin-top: 0.15rem;
	color: var(--fg-dim);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

widget[type="codex-chats"] codex-chats-meta-grid {
	display: block;
	border-top: 1px solid var(--border);
}

widget[type="codex-chats"] codex-chats-meta-row {
	display: grid;
	grid-template-columns: minmax(5.5rem, 0.35fr) minmax(0, 1fr);
	gap: 0.6rem;
	padding: 0.32rem 0;
	border-bottom: 1px solid var(--border);
}

widget[type="codex-chats"] codex-chats-meta-label {
	display: block;
	color: var(--fg-dim);
	font-size: 0.72rem;
}

widget[type="codex-chats"] codex-chats-meta-value {
	display: block;
	min-width: 0;
	color: var(--fg);
	font-family: var(--font-mono);
	font-size: 0.74rem;
	overflow-wrap: anywhere;
}

widget[type="codex-chats"] codex-chats-transcript {
	display: block;
}

widget[type="codex-chats"] codex-chats-message {
	display: block;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--border);
}

widget[type="codex-chats"] codex-chats-message-header {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin-bottom: 0.25rem;
}

widget[type="codex-chats"] codex-chats-message-role {
	display: block;
	color: var(--fg-em);
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
}

widget[type="codex-chats"] codex-chats-message-meta {
	display: block;
	min-width: 0;
	color: var(--fg-dim);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

widget[type="codex-chats"] codex-chats-message-text {
	display: block;
	color: var(--fg);
	font-family: var(--font-mono);
	font-size: 0.75rem;
	line-height: 1.35;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

widget[type="codex-chats"] codex-chats-message-raw {
	box-sizing: border-box;
	max-height: 200px;
	margin-top: 0.3rem;
	padding: 0.25rem 0.35rem;
	overflow: auto;
	background: var(--bg-base);
	color: var(--fg-dim);
	border: 1px solid var(--border);
	font-family: var(--font-mono);
	font-size: 0.68rem;
	line-height: 1.25;
	white-space: pre;
}

widget[type="codex-chats"] codex-chats-composer-section {
	position: sticky;
	bottom: -0.5rem;
	z-index: 2;
	display: block;
	margin: 0.75rem -0.5rem -0.5rem;
	padding: 0.5rem;
	border-top: 1px solid var(--border);
	background: var(--bg-chrome);
}

widget[type="codex-chats"] codex-chats-composer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem;
	align-items: end;
}

widget[type="codex-chats"] codex-chats-composer textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 5.5rem;
	resize: vertical;
	padding: 0.45rem 0.5rem;
	background: var(--bg);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 2px;
	font: inherit;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	line-height: 1.35;
}

widget[type="codex-chats"] codex-chats-composer textarea:focus {
	outline: 1px solid var(--workspace-accent);
	outline-offset: -1px;
}

widget[type="codex-chats"] codex-chats-composer button {
	padding: 0.42rem 0.7rem;
	background: var(--bg-elev);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 2px;
	font: inherit;
	font-size: 0.78rem;
	cursor: pointer;
}

widget[type="codex-chats"] codex-chats-composer button:disabled {
	cursor: default;
	opacity: 0.6;
}
