:root { --verde: #24370A; --verde-2: #324B0B; --dourado: #DDB23F; --creme: #FBF8F1; --creme-2: #EFE7D3; --linha: #E6DFCF; --texto: #2B2B22; --suave: #5B5F57; --erro: #A2261B; --ok: #2F6B1E; --raio: 14px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--creme); color: var(--texto); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 6px 0 4px; color: var(--verde); }
h2 { font-size: 1.2rem; margin: 0; color: var(--verde); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--dourado); outline-offset: 2px; }

.topo { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 6px 12px 6px 16px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--verde); color: var(--creme); }
.topo__marca { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.topo__marca span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo__s { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--dourado); color: var(--verde); font-weight: 700; flex: none; }
.topo__sair { min-height: 44px; padding: 0 12px; border: 1px solid rgba(243, 233, 204, .5); border-radius: 999px; background: none; color: var(--creme); cursor: pointer; flex: none; }

.status { position: sticky; top: 56px; z-index: 4; padding: 10px 16px; font-size: .95rem; font-weight: 500; background: var(--creme-2); color: var(--verde); }
.status--ok { background: #E3EFD9; color: var(--ok); }
.status--erro { background: #F6DEDA; color: var(--erro); }

.tela { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(48px + env(safe-area-inset-bottom)); }
.dica { color: var(--suave); margin: 4px 0 12px; }
.dica--pequena { font-size: .9rem; }
.rodape { text-align: center; color: var(--suave); font-size: .95rem; margin-top: 24px; }
.opcional { font-weight: 400; color: var(--suave); font-size: .9rem; }
.cartao { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin-top: 12px; }
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .95rem; }
input, textarea { width: 100%; font: inherit; font-size: 17px; padding: 12px; border: 1px solid #CFC6B2; border-radius: 12px; background: #fff; color: var(--texto); }
input:focus, textarea:focus { outline: 3px solid rgba(221, 178, 63, .55); border-color: var(--verde-2); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; min-height: 44px; }
.check input { width: 24px; height: 24px; flex: none; }
.senha { position: relative; }
.senha input { padding-right: 104px; min-height: 56px; }
.senha__ver { position: absolute; right: 4px; top: 4px; bottom: 4px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--creme-2); color: var(--verde); cursor: pointer; }

.botao { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; margin-top: 16px; border: 0; border-radius: 999px; background: var(--dourado); color: var(--verde); font-weight: 700; font-size: 1.05rem; cursor: pointer; width: 100%; }
.botao--grande { min-height: 60px; font-size: 1.15rem; margin-top: 8px; }
.botao--claro { background: #fff; border: 1.5px solid var(--verde-2); font-weight: 600; }
.botao--perigo { background: var(--erro); color: #fff; }
.botao[disabled] { opacity: .6; cursor: default; }
.duplo { display: flex; gap: 10px; }
.duplo .botao { flex: 1; }
.erro { color: var(--erro); margin: 10px 0 0; font-weight: 500; }
.voltar { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--verde); font-weight: 600; font-size: 1.05rem; cursor: pointer; }

.linhas { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.linha { display: flex; gap: 14px; align-items: center; width: 100%; min-height: 88px; text-align: left; background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: 8px 12px 8px 8px; color: inherit; cursor: pointer; }
.linha img, .linha .sem-foto { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; background: var(--creme-2); }
.linha__texto { flex: 1; min-width: 0; }
.linha strong { display: block; color: var(--verde); font-size: 1.1rem; }
.linha small { color: var(--suave); font-size: .95rem; }
.linha .fora { display: block; color: var(--erro); }
.linha::after { content: "›"; font-size: 1.8rem; color: var(--suave); }

.enviar { display: block; margin: 8px 0 0; }
.enviar input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.enviar input:focus-visible + .botao { outline: 3px solid var(--dourado); outline-offset: 2px; }

.grade { list-style: none; padding: 0; margin: 12px 0 18px; display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 620px) { .grade { grid-template-columns: repeat(4, 1fr); } }
.grade__item { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--creme-2); cursor: pointer; }
.grade__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grade__item--oculta img { opacity: .35; filter: grayscale(1); }
.grade__vazio { grid-column: 1 / -1; text-align: center; padding: 28px 12px; border: 2px dashed var(--linha); border-radius: var(--raio); color: var(--suave); }
.selo { position: absolute; left: 6px; bottom: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(0, 0, 0, .72); color: #fff; font-size: .85rem; line-height: 1.3; max-width: calc(100% - 12px); }
.selo--capa { left: auto; right: 6px; top: 6px; bottom: auto; background: var(--dourado); color: var(--verde); font-weight: 700; }
.selo--erro { background: var(--erro); }
.selo--meio { inset: 0; margin: auto; width: max-content; height: max-content; }
.play { position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.play::after { content: ""; position: absolute; left: 15px; top: 11px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.enviando { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .7); overflow: hidden; }
.enviando span { display: block; height: 100%; background: var(--verde-2); width: 0; transition: width .2s; }
.girando { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .6); border-top-color: var(--verde-2); animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .girando { animation: none; } }

.textos summary { font-weight: 600; color: var(--verde); cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.ver-site { display: block; margin: 18px 0 0; text-align: center; color: var(--verde); font-weight: 600; min-height: 44px; line-height: 44px; }

/* Folha de edição */
.folha { width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--creme); color: var(--texto); }
@media (min-width: 620px) { .folha { margin: auto; border-radius: 20px; } }
.folha::backdrop, .confirma::backdrop { background: rgba(20, 28, 8, .55); }
.folha__corpo { padding: 12px 16px 0; }
.folha { overflow-y: auto; overscroll-behavior: contain; }
.folha__topo { display: flex; justify-content: space-between; align-items: center; }
.folha__fechar { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--creme-2); color: var(--verde); font-size: 1.6rem; cursor: pointer; }
.folha__visual { margin-top: 8px; border-radius: 12px; overflow: hidden; background: #000; }
.folha__visual img, .folha__visual video { display: block; width: 100%; max-height: 28dvh; object-fit: contain; background: #000; }
.folha__grupo { margin: 18px 0 6px; font-weight: 600; font-size: .95rem; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mini { flex: 1 1 auto; min-height: 48px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #CFC6B2; background: #fff; color: var(--verde); font-weight: 600; font-size: .95rem; cursor: pointer; }
.mini[disabled] { opacity: .55; border-style: dashed; cursor: default; }
.mini--ativo { background: var(--dourado); border-color: var(--dourado); }
.mais { margin-top: 12px; }
.mais summary { min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--verde); cursor: pointer; }
.link-perigo { display: block; margin: 18px auto 0; min-height: 44px; border: 0; background: none; color: var(--erro); font-weight: 600; text-decoration: underline; cursor: pointer; }
.confirma { width: calc(100% - 32px); max-width: 420px; border: 0; border-radius: 18px; padding: 20px; background: #fff; color: var(--texto); }
.confirma p { margin: 0; font-size: 1.05rem; }

.status { display: flex; align-items: center; gap: 8px; }
.status #status-texto { flex: 1; }
.status__fechar { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: rgba(0,0,0,.08); color: inherit; font-size: 1.3rem; cursor: pointer; }
.titulo-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mini--auto { flex: none; }
.textos summary::after, .mais summary::after { content: "▾"; margin-left: auto; font-size: 1.2rem; }
.textos[open] summary::after, .mais[open] summary::after { content: "▴"; }
.textos summary { padding: 0 4px; }
.folha__aviso { min-height: 1.4em; margin: 4px 0 0; color: var(--ok); font-weight: 600; font-size: .95rem; }
.folha__aviso--erro { color: var(--erro); }
.folha__rodape { position: sticky; bottom: 0; margin: 12px -16px 0; padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--creme); border-top: 1px solid var(--linha); }
.folha__rodape .botao { margin-top: 0; }
.separador { border: 0; border-top: 1px solid var(--linha); margin: 20px 0 0; }
.confirma__visual img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 10px; margin: 0 auto 12px; }
