/**
 * Revista e catálogo — estilos do editor do cliente.
 *
 * Herda as variáveis de cor e tipografia do chat para não haver dois sistemas
 * visuais na mesma página.
 */

.agt-chat .agt-rev {
	margin-top: 1.4rem;
	padding: clamp(1rem, 2.4vw, 1.6rem);
	border: 1px solid var(--agt-line);
	border-radius: var(--agt-radius-sm);
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(240, 172, 50, 0.08), transparent 55%),
		var(--agt-card-2);
	color: var(--agt-ink);
	font-family: var(--agt-font-body);
}

.agt-chat .agt-rev-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.1rem;
}

.agt-chat .agt-rev-head-side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.4rem;
}

.agt-chat .agt-rev-balance-pill {
	padding: 0.24rem 0.55rem;
	border: 1px solid rgba(240, 172, 50, 0.32);
	border-radius: var(--agt-radius-pill);
	background: rgba(240, 172, 50, 0.1);
	color: var(--agt-amber-soft);
	font-size: 0.68rem;
	font-weight: 700;
	white-space: nowrap;
}

/* ------------------------------------------------------------ layout */

.agt-chat .agt-rev-layout {
	display: grid;
	grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
	gap: 1.1rem;
	align-items: start;
}

.agt-chat .agt-rev-side {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	min-width: 0;
}

.agt-chat .agt-rev-main {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	min-width: 0;
}

.agt-chat .agt-rev-panel {
	padding: 0.85rem;
	border: 1px solid var(--agt-line);
	border-radius: 14px;
	background: rgba(255, 250, 243, 0.02);
}

.agt-chat .agt-rev-panel-title {
	margin: 0 0 0.6rem;
	color: var(--agt-muted);
	font-family: var(--agt-font-display);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.agt-chat .agt-rev-field {
	display: flex;
	flex-direction: column;
	gap: 0.28rem;
	margin-bottom: 0.6rem;
	min-width: 0;
}

.agt-chat .agt-rev-field > span {
	color: var(--agt-muted);
	font-size: 0.72rem;
	font-weight: 600;
}

.agt-chat .agt-rev-field input,
.agt-chat .agt-rev-field select,
.agt-chat .agt-rev-field textarea {
	width: 100%;
	padding: 0.45rem 0.55rem;
	border: 1px solid var(--agt-line-strong);
	border-radius: 10px;
	background: var(--agt-card);
	color: var(--agt-ink);
	font-family: var(--agt-font-body);
	font-size: 0.82rem;
}

.agt-chat .agt-rev-field textarea {
	resize: vertical;
	line-height: 1.5;
}

.agt-chat .agt-rev-field input[type="file"] {
	padding: 0.3rem;
	font-size: 0.72rem;
}

.agt-chat .agt-rev-field input:focus-visible,
.agt-chat .agt-rev-field select:focus-visible,
.agt-chat .agt-rev-field textarea:focus-visible {
	outline: 2px solid var(--agt-amber);
	outline-offset: 1px;
}

.agt-chat .agt-rev-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.6rem;
}

.agt-chat .agt-rev-hint {
	margin: 0;
	color: var(--agt-muted);
	font-size: 0.72rem;
	line-height: 1.5;
}

/* ------------------------------------------------------------ páginas */

.agt-chat .agt-rev-pages {
	display: flex;
	flex-direction: column;
	gap: 0.32rem;
	margin: 0 0 0.6rem;
	padding: 0;
	list-style: none;
}

.agt-chat .agt-rev-page {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto auto auto;
	align-items: center;
	gap: 0.3rem;
	padding: 0.3rem;
	border: 1px solid transparent;
	border-radius: 10px;
	background: rgba(255, 250, 243, 0.03);
}

.agt-chat .agt-rev-page.is-selected {
	border-color: rgba(240, 172, 50, 0.45);
	background: rgba(240, 172, 50, 0.08);
}

.agt-chat .agt-rev-page-main {
	padding: 0.1rem 0.25rem;
	border: 0;
	background: none;
	color: var(--agt-ink);
	font-size: 0.76rem;
	text-align: left;
	cursor: pointer;
}

.agt-chat .agt-rev-page-type {
	padding: 0.2rem 0.3rem;
	border: 1px solid var(--agt-line-strong);
	border-radius: 8px;
	background: var(--agt-card);
	color: var(--agt-ink);
	font-size: 0.7rem;
}

.agt-chat .agt-rev-page-btn {
	width: 22px;
	height: 22px;
	border: 1px solid var(--agt-line-strong);
	border-radius: 6px;
	background: rgba(255, 250, 243, 0.04);
	color: var(--agt-muted);
	font-size: 0.7rem;
	line-height: 1;
	cursor: pointer;
}

.agt-chat .agt-rev-page-btn:hover {
	border-color: var(--agt-amber);
	color: var(--agt-amber-soft);
}

.agt-chat .agt-rev-page-btn--del:hover {
	border-color: rgba(255, 106, 106, 0.6);
	color: #ffc9c9;
}

/* ------------------------------------------------------------ resumo */

.agt-chat .agt-rev-summary {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.agt-chat .agt-rev-summary li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.6rem;
	font-size: 0.76rem;
}

.agt-chat .agt-rev-summary span {
	color: var(--agt-muted);
}

.agt-chat .agt-rev-summary strong {
	color: var(--agt-ink);
	font-weight: 700;
}

.agt-chat .agt-rev-warnings {
	margin: 0.6rem 0 0;
	padding: 0.5rem 0.6rem;
	border: 1px solid rgba(240, 172, 50, 0.3);
	border-radius: 10px;
	background: rgba(240, 172, 50, 0.08);
	color: var(--agt-amber-soft);
	font-size: 0.72rem;
	line-height: 1.5;
}

/* ------------------------------------------------------------ ações */

.agt-chat .agt-rev-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.agt-chat .agt-rev-btn {
	padding: 0.55rem 0.9rem;
	border: 1px solid var(--agt-line-strong);
	border-radius: var(--agt-radius-pill);
	background: rgba(255, 250, 243, 0.06);
	color: var(--agt-ink);
	font-family: var(--agt-font-display);
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.agt-chat .agt-rev-btn:hover:not(:disabled) {
	border-color: var(--agt-amber);
	color: var(--agt-amber-soft);
}

.agt-chat .agt-rev-btn:disabled {
	opacity: 0.55;
	cursor: progress;
}

.agt-chat .agt-rev-btn--primary {
	border-color: transparent;
	background: linear-gradient(135deg, var(--agt-amber), var(--agt-amber-deep));
	color: var(--agt-amber-ink);
}

.agt-chat .agt-rev-btn--primary:hover:not(:disabled) {
	color: var(--agt-amber-ink);
	filter: brightness(1.05);
}

.agt-chat .agt-rev-btn--ghost {
	background: transparent;
}

.agt-chat .agt-rev-download {
	align-self: center;
	color: var(--agt-amber);
	font-size: 0.78rem;
	font-weight: 700;
	text-decoration: underline;
}

/* ------------------------------------------------------------ palco */

.agt-chat .agt-rev-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
}

.agt-chat .agt-rev-toolbar-info {
	color: var(--agt-muted);
	font-size: 0.74rem;
}

.agt-chat .agt-rev-zoom {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.72rem;
	color: var(--agt-muted);
}

.agt-chat .agt-rev-zoom-btn {
	width: 24px;
	height: 24px;
	border: 1px solid var(--agt-line-strong);
	border-radius: 7px;
	background: rgba(255, 250, 243, 0.04);
	color: var(--agt-ink);
	font-size: 0.85rem;
	line-height: 1;
	cursor: pointer;
}

.agt-chat .agt-rev-stage {
	padding: 0.9rem;
	border: 1px dashed var(--agt-line-strong);
	border-radius: 14px;
	background:
		repeating-conic-gradient(rgba(255, 250, 243, 0.03) 0% 25%, transparent 0% 50%) 50% / 18px 18px,
		var(--agt-bg);
	max-height: 74vh;
	overflow: auto;
}

.agt-chat .agt-rev-sheets {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
	align-items: flex-start;
	justify-content: center;
}

.agt-chat .agt-rev-sheet {
	position: relative;
	flex: 0 0 auto;
	overflow: hidden;
	border: 1px solid rgba(255, 250, 243, 0.14);
	border-radius: 2px;
	background: var(--agt-card);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
	cursor: pointer;
}

.agt-chat .agt-rev-sheet.is-selected {
	outline: 2px solid var(--agt-amber);
	outline-offset: 2px;
}

.agt-chat .agt-rev-sheet-n {
	position: absolute;
	right: 3px;
	bottom: 2px;
	color: rgba(255, 250, 243, 0.34);
	font-size: 0.6rem;
	font-weight: 700;
	pointer-events: none;
}

.agt-chat .agt-rev-block {
	position: absolute;
	overflow: hidden;
	border-radius: 1px;
	cursor: text;
}

.agt-chat .agt-rev-block.is-selected {
	outline: 1px solid var(--agt-amber);
	background: rgba(240, 172, 50, 0.08);
}

.agt-chat .agt-rev-block--image {
	border: 1px solid rgba(255, 250, 243, 0.16);
	background-color: rgba(255, 250, 243, 0.05);
	background-size: cover;
	background-position: center;
	color: var(--agt-muted);
	font-size: 0.6rem;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

/* ------------------------------------------------------------ editor */

.agt-chat .agt-rev-editor {
	padding: 0.85rem;
	border: 1px solid rgba(240, 172, 50, 0.35);
	border-radius: 14px;
	background: rgba(240, 172, 50, 0.06);
}

.agt-chat .agt-rev-editor-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem;
	margin-bottom: 0.6rem;
}

.agt-chat .agt-rev-editor-head strong {
	font-family: var(--agt-font-display);
	font-size: 0.8rem;
	font-weight: 750;
}

/* ------------------------------------------------------------ responsivo */

@media (max-width: 900px) {
	.agt-chat .agt-rev-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.agt-chat .agt-rev-stage {
		max-height: 58vh;
	}
}

@media (max-width: 560px) {
	.agt-chat .agt-rev-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.agt-chat .agt-rev-head {
		flex-direction: column;
	}

	.agt-chat .agt-rev-head-side {
		flex-direction: row;
		align-items: center;
	}
}
