/* Myth Box — front. Conceito "aparte costurado": cartão com lavado derivado da
   cor do tema (color-mix), etiqueta costurada na borda superior, abas em
   segmented control e CTA em forma de campo de chat. Sem webfonts. */

:root {
	--mythbox-accent: #0f6fff;
	--mythbox-bg: #ffffff;
	--mythbox-surface: #f5f6f8;
	--mythbox-text: #171a20;
	--mythbox-muted: #69717f;
	--mythbox-border: #e6e8ee;
	--mythbox-radius: 18px;
	--mythbox-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	/* Derivadas (fallback sem color-mix) */
	--mythbox-wash: var(--mythbox-surface);
	--mythbox-wash-2: var(--mythbox-surface);
	--mythbox-line: var(--mythbox-border);
	--mythbox-glow: rgba(0, 0, 0, 0.10);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
	:root {
		--mythbox-wash: color-mix(in srgb, var(--mythbox-accent) 6%, var(--mythbox-bg));
		--mythbox-wash-2: color-mix(in srgb, var(--mythbox-accent) 12%, var(--mythbox-bg));
		--mythbox-line: color-mix(in srgb, var(--mythbox-accent) 22%, var(--mythbox-border));
		--mythbox-glow: color-mix(in srgb, var(--mythbox-accent) 30%, transparent);
	}
}
@media (prefers-color-scheme: dark) {
	:root:not([data-mythbox-light]) {
		--mythbox-bg: #16181d;
		--mythbox-surface: #1f2229;
		--mythbox-text: #eceef2;
		--mythbox-muted: #9aa1ad;
		--mythbox-border: #2c303a;
	}
}

/* ------------------------------------------------------------ Barra social */
.mythbox-share {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 20px 0;
	font-family: var(--mythbox-font);
}
.mythbox-share-row { display: flex; gap: 10px; align-items: stretch; }
.mythbox-share-main {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: #1baa4f;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	padding: 14px 16px;
	border-radius: 14px;
	text-decoration: none;
	transition: filter 0.16s;
}
.mythbox-share-main:hover { filter: brightness(1.06); color: #fff; }
.mythbox-share-main svg { width: 20px; height: 20px; }
.mythbox-share-sq {
	appearance: none;
	flex: 0 0 52px;
	min-height: 50px;
	border: 0;
	border-radius: 14px;
	display: inline-grid;
	place-items: center;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.16s, transform 0.16s;
}
.mythbox-share-sq:hover { filter: brightness(1.1); transform: translateY(-1px); }
.mythbox-share-x { background: #000; color: #fff; border: 1px solid #2a2a2a; }
.mythbox-share-fb { background: #1877f2; color: #fff; }
.mythbox-share-tg { background: #229ed9; color: #fff; }
.mythbox-share-copy { background: var(--mythbox-bg); border: 1px solid var(--mythbox-border); color: var(--mythbox-text); }
.mythbox-share-copy.is-copied { background: var(--mythbox-accent); border-color: var(--mythbox-accent); color: #fff; }
.mythbox-share-row:not(:has(.mythbox-share-main)) .mythbox-share-sq { flex: 1; }

.mythbox-follow-google {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	background: #ffffff;
	border: 1px solid #dadce0;
	color: #1f1f1f;
	font-size: 15.5px;
	font-weight: 600;
	padding: 13px 16px;
	border-radius: 14px;
	text-decoration: none;
	box-sizing: border-box;
	transition: box-shadow 0.16s;
}
.mythbox-follow-google:hover { color: #1f1f1f; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.mythbox-follow-google svg { width: 18px; height: 18px; }
.mythbox-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ea4335; animation: mythbox-pulse 2s infinite; }

/* ------------------------------------------------------------------ Cartão */
.mythbox {
	position: relative;
	margin: 28px 0;
	padding: 18px 20px 14px;
	background: linear-gradient(180deg, var(--mythbox-wash) 0, var(--mythbox-bg) 150px);
	border: 1px solid var(--mythbox-line);
	border-radius: var(--mythbox-radius);
	font-family: var(--mythbox-font);
	color: var(--mythbox-text);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 16px 40px -24px var(--mythbox-glow);
}

/* Cabeçalho: ponto + nome | IA (etiqueta discreta) */
.mythbox-head { display: flex; flex-direction: column; }
.mythbox-brandrow { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; }
.mythbox-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--mythbox-text);
}
.mythbox-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mythbox-accent); }
.mythbox-sep { width: 1px; height: 16px; background: var(--mythbox-border); }
.mythbox-ia {
	font-style: normal;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.12em;
	color: var(--mythbox-accent);
	border: 1px solid var(--mythbox-accent);
	border-radius: 6px;
	padding: 3px 8px;
}

/* Abas: sublinhado com contador em selo */
.mythbox-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var(--mythbox-border);
	margin: 0 -20px;
	padding: 0 12px;
}
.mythbox-tab {
	appearance: none;
	position: relative;
	border: 0;
	background: transparent;
	color: var(--mythbox-muted);
	font-family: var(--mythbox-font);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 12px 12px 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.16s;
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.mythbox-tab:hover { color: var(--mythbox-text); }
.mythbox-tab em {
	font-style: normal;
	display: inline-grid;
	place-items: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--mythbox-accent);
	color: #fff;
	font-size: 10.5px;
	font-weight: 800;
	opacity: 1;
	margin: 0;
}
.mythbox-tab.is-active { color: var(--mythbox-text); }
.mythbox-tab.is-active::after {
	content: "";
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: -1px;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--mythbox-accent);
}

/* Painéis */
.mythbox-pane { display: none; padding-top: 18px; }
.mythbox-pane.is-active { display: block; }

/* Chaves: cards em carrossel com "espiada" do próximo */
.mythbox-track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	margin: 0 -20px;
	padding: 2px 20px;
	-webkit-overflow-scrolling: touch;
}
.mythbox-track::-webkit-scrollbar { display: none; }
.mythbox-clave {
	flex: 0 0 calc(100% - 36px);
	scroll-snap-align: start;
	margin: 0;
	box-sizing: border-box;
	background: var(--mythbox-bg);
	border: 1px solid var(--mythbox-line);
	border-left: 3px solid var(--mythbox-accent);
	border-radius: 14px;
	padding: 16px 18px;
	font-size: 16px;
	line-height: 1.6;
	font-weight: 500;
	letter-spacing: -0.005em;
}
.mythbox-track.is-single .mythbox-clave { flex-basis: 100%; }
.mythbox-carousel-nav {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 14px;
	min-height: 34px;
}
.mythbox-cnext {
	appearance: none;
	position: absolute;
	right: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--mythbox-line);
	background: var(--mythbox-bg);
	color: var(--mythbox-text);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.16s, color 0.16s;
}
.mythbox-cnext:hover { border-color: var(--mythbox-accent); color: var(--mythbox-accent); }
.mythbox-cdots { display: inline-flex; gap: 9px; }
.mythbox-cdots i {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	border: 2px solid var(--mythbox-accent);
	background: transparent;
	box-sizing: border-box;
	cursor: pointer;
	transition: background 0.16s;
}
.mythbox-cdots i.is-active { background: var(--mythbox-accent); }

/* CTA: contornado na cor do tema */
.mythbox-cta {
	appearance: none;
	margin-top: 16px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: transparent;
	border: 1.5px solid var(--mythbox-accent);
	color: var(--mythbox-accent);
	border-radius: 12px;
	padding: 12px 18px;
	cursor: pointer;
	font-family: var(--mythbox-font);
	font-size: 15px;
	font-weight: 700;
	transition: background 0.16s, color 0.16s;
}
.mythbox-cta-ph { color: inherit; font-size: inherit; text-align: left; }
.mythbox-cta-go {
	font-style: normal;
	font-size: 17px;
	line-height: 1;
	transition: transform 0.18s;
}
.mythbox-cta:hover { background: var(--mythbox-accent); color: #fff; }
.mythbox-cta:hover .mythbox-cta-go { transform: translateX(3px); }

/* Perguntas: linhas tocáveis */
.mythbox-chips { display: flex; flex-direction: column; gap: 8px; }
.mythbox-chip {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	text-align: left;
	background: var(--mythbox-bg);
	border: 1px solid var(--mythbox-border);
	border-radius: 14px;
	padding: 12px 14px;
	font-family: var(--mythbox-font);
	font-size: 14.5px;
	font-weight: 500;
	color: var(--mythbox-text);
	cursor: pointer;
	transition: border-color 0.16s, background 0.16s;
}
.mythbox-chip::after {
	content: "→";
	color: var(--mythbox-accent);
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 0.16s, transform 0.16s;
}
.mythbox-chip:hover { border-color: var(--mythbox-accent); background: var(--mythbox-wash); }
.mythbox-chip:hover::after { opacity: 1; transform: none; }
.mythbox-chips-hint { margin: 10px 0 0; font-size: 12.5px; color: var(--mythbox-muted); }

/* Descubra */
.mythbox-ds { list-style: none; margin: 0; padding: 0; }
.mythbox-ds li + li { border-top: 1px solid var(--mythbox-border); }
.mythbox-ds a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 6px;
	border-radius: 12px;
	text-decoration: none;
	color: var(--mythbox-text);
	transition: background 0.16s;
}
.mythbox-ds a:hover { background: var(--mythbox-wash); }
.mythbox-ds img { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.mythbox-ds b {
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.mythbox-ds small { display: block; margin-top: 3px; font-size: 12px; color: var(--mythbox-muted); }
.mythbox-ds-more { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 700; color: var(--mythbox-accent); text-decoration: none; }

/* Rodapé */
.mythbox-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 16px;
	padding-top: 10px;
	border-top: 1px solid var(--mythbox-border);
	font-size: 11.5px;
	color: var(--mythbox-muted);
}
.mythbox-foot > span::before { content: "ⓘ"; margin-right: 6px; opacity: 0.7; }
.mythbox-foot a { color: inherit; text-decoration: underline; white-space: nowrap; }
.mythbox-foot a:hover { color: var(--mythbox-accent); }

/* ------------------------------------------------------------ Chat / botão */
.mythbox-launcher {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 99998;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	background: var(--mythbox-accent);
	color: #fff;
	font-family: var(--mythbox-font);
	font-weight: 700;
	font-size: 14px;
	padding: 12px 18px;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 10px 28px -6px var(--mythbox-glow);
	transition: transform 0.16s;
}
.mythbox-launcher:hover { transform: translateY(-2px); }
.mythbox-launcher-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: mythbox-pulse 2s infinite; }
.mythbox-launcher-x { font-style: normal; opacity: 0.7; margin-left: 4px; padding: 0 2px; }
.mythbox-launcher-x:hover { opacity: 1; }

.mythbox-chat { position: fixed; inset: 0; z-index: 99999; pointer-events: none; font-family: var(--mythbox-font); }
.mythbox-chat-panel {
	pointer-events: auto;
	position: absolute;
	right: 18px;
	bottom: 18px;
	width: min(400px, calc(100vw - 24px));
	height: min(560px, calc(100vh - 40px));
	display: flex;
	flex-direction: column;
	background: var(--mythbox-bg);
	color: var(--mythbox-text);
	border: 1px solid var(--mythbox-line);
	border-radius: 20px;
	box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}
.mythbox-chat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 13px 16px;
	background: linear-gradient(180deg, var(--mythbox-wash-2), var(--mythbox-wash));
	border-bottom: 1px solid var(--mythbox-line);
	color: var(--mythbox-text);
	font-size: 14px;
	font-weight: 700;
}
.mythbox-chat-head::before { content: "✦"; color: var(--mythbox-accent); margin-right: 8px; }
.mythbox-chat-close { appearance: none; border: 0; background: transparent; color: var(--mythbox-muted); font-size: 20px; cursor: pointer; line-height: 1; }
.mythbox-chat-close:hover { color: var(--mythbox-text); }

.mythbox-chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.mythbox-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.mythbox-msg-user { align-self: flex-end; background: var(--mythbox-accent); color: #fff; border-bottom-right-radius: 5px; }
.mythbox-msg-assistant { align-self: flex-start; background: var(--mythbox-wash-2); border-bottom-left-radius: 5px; }
.mythbox-msg.is-typing { color: var(--mythbox-muted); font-style: italic; }

.mythbox-chat-upgrade { padding: 8px 14px; background: var(--mythbox-wash); border-top: 1px solid var(--mythbox-border); font-size: 13px; }
.mythbox-chat-upgrade a { color: var(--mythbox-accent); font-weight: 700; text-decoration: none; }

.mythbox-chat-reg { padding: 16px; border-top: 1px solid var(--mythbox-border); background: var(--mythbox-wash); }
.mythbox-chat-reg h4 { margin: 0 0 6px; font-size: 15px; }
.mythbox-chat-reg p { margin: 0 0 12px; font-size: 13.5px; color: var(--mythbox-muted); }
.mythbox-reg-optin { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin-top: 10px; color: var(--mythbox-muted); }
.mythbox-reg-legal { font-size: 11.5px !important; margin: 8px 0 0 !important; }
.mythbox-reg-login {
	display: inline-block;
	background: var(--mythbox-accent);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	padding: 10px 16px;
	border-radius: 999px;
	text-decoration: none;
}

.mythbox-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--mythbox-border); }
.mythbox-chat-form input {
	flex: 1;
	border: 1px solid var(--mythbox-border);
	background: var(--mythbox-bg);
	color: var(--mythbox-text);
	border-radius: 999px;
	padding: 10px 15px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.16s, box-shadow 0.16s;
}
.mythbox-chat-form input:focus { border-color: var(--mythbox-accent); box-shadow: 0 0 0 3px var(--mythbox-wash-2); }
.mythbox-chat-form button {
	appearance: none;
	border: 0;
	background: var(--mythbox-accent);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	padding: 10px 16px;
	border-radius: 999px;
	cursor: pointer;
}

/* ------------------------------------------------------- Acessibilidade */
.mythbox :focus-visible,
.mythbox-share :focus-visible,
.mythbox-chat :focus-visible,
.mythbox-launcher:focus-visible {
	outline: 2px solid var(--mythbox-accent);
	outline-offset: 2px;
}

@keyframes mythbox-rise {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}
@keyframes mythbox-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
	.mythbox-launcher-dot { animation: none; }
	.mythbox-share-sq:hover,
	.mythbox-launcher:hover,
	.mythbox-cta:hover .mythbox-cta-go { transform: none; }
	.mythbox-live-dot { animation: none; }
	.mythbox-track { scroll-behavior: auto; }
}

@media (max-width: 520px) {
	.mythbox { padding: 16px 14px 12px; }
	.mythbox-tabs { margin: 0 -14px; padding: 0 6px; }
	.mythbox-track { margin: 0 -14px; padding: 2px 14px; }
	.mythbox-tab { font-size: 12px; padding: 11px 9px 13px; }
	.mythbox-follow-google { margin-left: 0; }
	.mythbox-chat-panel { right: 8px; bottom: 8px; height: min(70vh, 560px); }
}
