:root {
  --fundo: #f4f1ec;
  --texto: #2b2925;
  --suave: #6f6a62;
  --linha: #e1dbd2;
  --acento: #3e4a1f;          /* verde da Perplan (barra do site) — confirmar com a marca */
  --chip: #ffffff;
  --raio: 10px;
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--texto);
  background: var(--fundo);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fundo); }
button { font: inherit; color: inherit; cursor: pointer; }

.cfg { display: grid; grid-template-columns: 1fr; height: 100dvh; }
.painel-aberto .cfg { grid-template-columns: 1fr 340px; }
.cfg__palco { position: relative; overflow: hidden; background: #ddd8cf; touch-action: none; }
.cfg__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cfg__antes { position: absolute; inset: 0; pointer-events: none; }
.cfg__antes img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cfg__divisor { position: absolute; top: 0; bottom: 0; width: 44px; margin-left: -22px; cursor: ew-resize; touch-action: none; }
.cfg__divisor::before { content: ''; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .3); }
.cfg__divisor span { position: absolute; top: 50%; left: 4px; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.cfg__divisor span::before { content: '‹ ›'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; color: var(--texto); }

.cfg__carregando { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center;
  background: var(--fundo); transition: opacity .5s; }
.cfg__carregando.ok { opacity: 0; pointer-events: none; }
.cfg__carregando p { margin: 0; color: var(--suave); font-size: 14px; }
.cfg__barra { width: 220px; height: 3px; background: var(--linha); border-radius: 3px; overflow: hidden; }
.cfg__barra i { display: block; height: 100%; width: 0; background: var(--acento); transition: width .2s; }

.cfg__acoes { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.cfg__btn { border: 0; background: rgba(255, 255, 255, .92); padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.cfg__btn:hover { background: #fff; }
/* troca de ambiente */
.cfg__ambientes { position: absolute; top: 16px; left: 16px; display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.cfg__ambientes button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--suave); }
.cfg__ambientes button[aria-current="page"] { background: var(--acento); color: #fff; }
.em-foco .cfg__ambientes { display: none; }
@media (max-width: 820px) { .cfg__ambientes { top: 12px; left: 12px; } .cfg__ambientes button { padding: 7px 11px; font-size: 12px; } }
/* momento do dia */
.cfg__luz { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.cfg__luz[hidden] { display: none; }
.cfg__luz button { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--suave); transition: background .3s, color .3s; }
.cfg__luz button[hidden] { display: none; }
.cfg__luz button[aria-pressed="true"] { background: var(--acento); color: #fff; }
.cfg__luz svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cfg__luz button[data-estado="noite"] svg { fill: currentColor; stroke: none; }
.mudando-luz .cfg__luz button { pointer-events: none; }
.em-foco .cfg__luz { display: none; }
@media (max-width: 820px) {
  .cfg__luz { right: auto; bottom: auto; left: 12px; top: 58px; }
  .cfg__luz button { padding: 8px 10px; }
  .cfg__luz span { display: none; }
}
/* botão que abre a personalização */
.cfg__personalizar { position: absolute; top: 16px; right: 16px; border: 0; background: var(--acento); color: #fff; padding: 11px 18px;
  border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.painel-aberto .cfg__personalizar { display: none; }
/* pontos sobre os objetos */
.cfg__marcadores { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cfg__ponto { position: absolute; left: 0; top: 0; width: 0; height: 0; border: 0; padding: 0; background: none; pointer-events: auto; }
.cfg__ponto[hidden] { display: none; }
.cfg__ponto i { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .95);
  box-shadow: 0 0 0 3px var(--acento), 0 4px 12px rgba(0, 0, 0, .3); }
.cfg__ponto i::before { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 20px; font-weight: 600; color: var(--acento); }
.cfg__ponto i::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #fff; animation: pulso 2s ease-out infinite; }
@keyframes pulso { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cfg__ponto i::after { animation: none; } }
.cfg__ponto span { position: absolute; left: 22px; top: -13px; white-space: nowrap; background: rgba(255, 255, 255, .95); color: var(--texto);
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.cfg__ponto:hover span, .cfg__ponto:focus-visible span { opacity: 1; transform: none; }
/* cartão da peça em foco */
.cfg__cartao { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 32px));
  background: rgba(250, 248, 244, .97); border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); padding: 14px 18px 18px; }
.cfg__cartao[hidden] { display: none; }
.cfg__cartao-topo { display: flex; align-items: center; gap: 12px; }
.cfg__cartao-topo h2 { margin: 0; font-size: 17px; font-weight: 600; }
.cfg__voltar { border: 1px solid var(--linha); background: #fff; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 500; }
.cfg__cartao .cfg__grupo h2 { margin-top: 14px; }
.cfg__info { margin: 12px 0 0; font-size: 14px; color: var(--suave); }
.em-foco .cfg__dica, .em-foco .cfg__acoes { display: none; }
.cfg__dica { position: absolute; left: 50%; transform: translateX(-50%); bottom: 22px; margin: 0; font-size: 12px; color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5); white-space: nowrap; pointer-events: none; }
@media (max-width: 1240px) { .cfg__dica { display: none; } }
.painel-aberto .cfg__dica { display: none; }
/* aviso rápido (link copiado) */
.cfg__aviso { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); margin: 0; padding: 10px 16px; border-radius: 999px;
  background: rgba(43, 41, 37, .92); color: #fff; font-size: 13px; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); max-width: calc(100% - 32px);
  text-align: center; animation: aviso .25s ease-out; }
.cfg__aviso[hidden] { display: none; }
@keyframes aviso { from { opacity: 0; transform: translate(-50%, -6px); } }

.cfg__painel { display: none; flex-direction: column; border-left: 1px solid var(--linha); background: var(--fundo); min-height: 0; }
.painel-aberto .cfg__painel { display: flex; }
.cfg__painel header { padding: 22px 22px 14px; border-bottom: 1px solid var(--linha); display: flex; justify-content: space-between; gap: 12px; }
.cfg__fechar { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--suave); width: 36px; height: 36px; border-radius: 50%; }
.cfg__fechar:hover { background: var(--linha); }
.cfg__instrucao { margin: 14px 22px 0; font-size: 13px; color: var(--suave); line-height: 1.45; }
.cfg__ponto-mini { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--acento); vertical-align: -1px; margin: 0 2px; }
.cfg__marca { margin: 0 0 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--acento); font-weight: 600; }
.cfg__titulo { margin: 0; font-size: 22px; font-weight: 600; }
.cfg__estilo { margin: 6px 0 0; font-size: 13px; color: var(--suave); }
.cfg__opcoes { flex: 1; overflow-y: auto; padding: 8px 22px 22px; }
.cfg__grupo[hidden] { display: none; }
.cfg__grupo h2 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); margin: 18px 0 10px; }
.cfg__escolhas { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg__chip { border: 1px solid var(--linha); background: var(--chip); padding: 8px 13px; border-radius: 999px; font-size: 13px; }
.cfg__chip[aria-pressed="true"] { border-color: var(--acento); background: var(--acento); color: #fff; }
.cfg__cor { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: var(--cor);
  box-shadow: 0 0 0 1px var(--linha); padding: 0; }
.cfg__cor[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--acento); }
/* combinações prontas */
.cfg__combos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cfg__combo { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border: 1px solid var(--linha); background: var(--chip);
  border-radius: var(--raio); padding: 10px 11px; font-size: 13px; font-weight: 500; text-align: left; transition: border-color .2s, box-shadow .2s; }
.cfg__combo:hover { border-color: #cfc6b8; }
.cfg__combo[aria-pressed="true"] { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento); }
.cfg__combo-cores { display: flex; }
.cfg__combo-cores i { width: 22px; height: 22px; border-radius: 50%; background: var(--cor); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--linha); }
.cfg__combo-cores i + i { margin-left: -6px; }
.cfg__painel footer { padding: 12px 22px 18px; font-size: 11px; color: var(--suave); border-top: 1px solid var(--linha); }

@media (max-width: 820px) {
  .cfg, .painel-aberto .cfg { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .painel-aberto .cfg { grid-template-rows: minmax(0, 60dvh) 1fr; }
  .cfg__cartao { bottom: 10px; padding: 12px 14px 14px; }
  .cfg__instrucao { margin: 10px 16px 0; }
  .cfg__painel { border-left: 0; border-top: 1px solid var(--linha); }
  .cfg__painel header { padding: 14px 16px 10px; }
  .cfg__titulo { font-size: 18px; }
  .cfg__opcoes { padding: 0 16px 16px; }
  .cfg__dica { display: none; }
  .cfg__acoes { left: 12px; bottom: 12px; }
}
