/* Conta, envio, categorias e organização (o visual da galeria fica em style.css) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.btn { background: none; color: inherit; font-family: inherit; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.perigo { color: #ff9b8f; border-color: #6b3530; }
.conta { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 36px; font-size: .875rem; }
.conta img, .conta .ini { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.conta .ini { display: grid; place-items: center; background: var(--line); font-weight: 600; }
.conta .nome { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
@media (max-width: 560px) { .conta .nome { display: none; } }
.g-btn { gap: 8px; white-space: nowrap; }
.barra-equipe { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px var(--pad) 0; }
#b-enviar { gap: .3em; }
@media (max-width: 480px) { .barra-equipe .btn { padding: 0 12px; font-size: .8125rem; } .so-largo { display: none; } }
.por { flex: none; display: flex; align-items: center; gap: 8px; max-width: 46%; color: var(--muted); font-size: .8125rem; }
.por select { width: auto; min-width: 0; max-width: 100%; min-height: 36px; border-radius: 999px; font-size: .8125rem; text-overflow: ellipsis; }
.escolha { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.escolha legend { padding: 0; margin-bottom: 8px; font-size: .875rem; color: var(--muted); }
.opcoes { display: flex; flex-wrap: wrap; gap: 8px; max-height: 30vh; overflow-y: auto; padding: 2px; }
.opcoes:empty { display: none; }
.dlg label.opcao { position: relative; display: block; cursor: pointer; }
.opcao input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opcao span { display: flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: .875rem; }
.opcao input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.opcao input:checked + span::before { content: "✓"; margin-right: 6px; }
.opcao input:indeterminate + span { border-color: var(--accent); color: var(--accent); }
.opcao input:indeterminate + span::before { content: "–"; margin-right: 6px; font-weight: 700; }
.opcao input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.barra-equipe .btn { gap: 7px; }
.barra-equipe .ic { flex: none; }
#b-organizar .ic-x, .organizando #b-organizar .ic-lapis { display: none; }
.organizando #b-organizar .ic-x { display: block; }
.organizando #b-organizar { border-color: var(--accent); color: var(--accent); }
.aviso { margin: 12px var(--pad) 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .875rem; }

.organizando .tile { cursor: pointer; }
.organizando .tile::after { content: ""; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50%; background: rgba(0, 0, 0, .45); display: grid; place-items: center; font: 700 14px/1 var(--sans); }
.organizando .tile.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.organizando .tile.sel::after { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.selo { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .65); font-size: .6875rem; pointer-events: none; }
.tile.oculta img.loaded { opacity: .4; }
.com-selecao { padding-bottom: 170px; }
.selecao { position: fixed; inset: auto 0 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); font-size: .875rem; }
.sel-acoes { display: flex; flex-wrap: wrap; gap: 8px; }

select, .dlg textarea, .dlg input:not([type=checkbox], [type=file], [type=range]) { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 400 1rem var(--sans); }
.dlg { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); overflow-y: auto; }
.dlg::backdrop { background: rgba(0, 0, 0, .7); }
.dlg form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.dlg h2 { font-size: 1.75rem; }
.dlg label { display: grid; gap: 6px; font-size: .875rem; color: var(--muted); }
.dlg label.marca { grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 32px; color: var(--text); }
.dlg .marca input { width: 20px; height: 20px; accent-color: var(--accent); }
.acoes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dlg p { margin: 0; font-size: .875rem; color: var(--muted); }
.dlg .erro { color: #ff9b8f; }
.dlg .erro:empty { display: none; }
.dlg label.solta { position: relative; place-items: center; align-content: center; min-height: 110px; padding: 16px; border: 2px dashed var(--line); border-radius: 12px; text-align: center; cursor: pointer; }
.solta.sobre, .solta:focus-within { border-color: var(--accent); color: var(--text); }
.solta input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.fila, .cats { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; max-height: 46vh; overflow-y: auto; }
.fila:empty, .cats:empty { display: none; }
.fila li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: .8125rem; }
.fila img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.fila span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila li > .campos { grid-column: 1 / -1; display: grid; gap: 8px; }
.fila li { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.fila li:last-child { border-bottom: 0; padding-bottom: 2px; }
.fila li > b, .fila li > .ico { grid-column: 4; }
.fila .btn { padding: 0 12px; font-size: .8125rem; }
.fila .ruim { color: #ff9b8f; }
.fila .ok { color: #8fd6a0; }
.cats li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 6px; align-items: center; }
.cats small { min-width: 2ch; text-align: right; color: var(--muted); }
.ico { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: none; color: inherit; font-size: 1rem; cursor: pointer; }
.ico.perigo { color: #ff9b8f; }
.ico:disabled { opacity: .3; cursor: default; }
.linha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
button.lb-link { background: none; font-family: inherit; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: .9375rem; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.com-selecao .toast { bottom: 170px; }
/* No celular o filtro de quem publicou fica numa linha própria, para as categorias usarem a largura toda */
@media (max-width: 560px) {
  .filtros { flex-wrap: wrap; gap: 10px; }
  .filters { flex-basis: 100%; margin-right: calc(var(--pad) * -1); padding-right: var(--pad); }
  .por { max-width: 100%; }
}

.foto-previa { display: flex; align-items: center; gap: 14px; }
.foto-previa img { width: 120px; height: 90px; object-fit: contain; border-radius: 6px; background: #08080a; }

/* Ajuste da foto no envio e na edição: girar, endireitar e recortar */
.dlg-ajuste { width: min(760px, calc(100vw - 16px)); }
@media (max-width: 560px) { .dlg-ajuste { padding: 16px; } .dlg-ajuste .acoes { flex-wrap: nowrap; } .dlg-ajuste .acoes .btn { padding: 0 14px; font-size: .875rem; white-space: nowrap; } .dlg-ajuste h2 { font-size: 1.375rem; } }
.aj-palco { display: flex; justify-content: center; background: #08080a; border-radius: 6px; }
.aj-area { position: relative; overflow: hidden; touch-action: none; user-select: none; }
.aj-area canvas { display: block; width: 100%; height: 100%; }
.aj-caixa { position: absolute; cursor: move; touch-action: none; outline: 1px solid #fff; outline-offset: -1px; box-shadow: 0 0 0 4000px rgba(0, 0, 0, .6);
  background: linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255, 255, 255, .5) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgba(255, 255, 255, .5) 0 calc(66.66% + .5px), transparent 0),
    linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255, 255, 255, .5) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgba(255, 255, 255, .5) 0 calc(66.66% + .5px), transparent 0); }
.aj-caixa:focus-visible { outline: 2px solid var(--accent); }
.aj-caixa i { position: absolute; width: 36px; height: 36px; touch-action: none; } /* área de toque grande; o desenho é o ::after */
.aj-caixa i::after { content: ""; position: absolute; }
.aj-caixa [data-alca=no] { left: 0; top: 0; cursor: nwse-resize; }
.aj-caixa [data-alca=ne] { right: 0; top: 0; cursor: nesw-resize; }
.aj-caixa [data-alca=so] { left: 0; bottom: 0; cursor: nesw-resize; }
.aj-caixa [data-alca=se] { right: 0; bottom: 0; cursor: nwse-resize; }
.aj-caixa [data-alca=no]::after, .aj-caixa [data-alca=ne]::after, .aj-caixa [data-alca=so]::after, .aj-caixa [data-alca=se]::after { width: 20px; height: 20px; border: 0 solid var(--accent); }
.aj-caixa [data-alca=no]::after { left: 0; top: 0; border-width: 4px 0 0 4px; }
.aj-caixa [data-alca=ne]::after { right: 0; top: 0; border-width: 4px 4px 0 0; }
.aj-caixa [data-alca=so]::after { left: 0; bottom: 0; border-width: 0 0 4px 4px; }
.aj-caixa [data-alca=se]::after { right: 0; bottom: 0; border-width: 0 4px 4px 0; }
.aj-caixa [data-alca=n], .aj-caixa [data-alca=s] { left: 36px; right: 36px; width: auto; height: 24px; cursor: ns-resize; }
.aj-caixa [data-alca=e], .aj-caixa [data-alca=o] { top: 36px; bottom: 36px; height: auto; width: 24px; cursor: ew-resize; }
.aj-caixa [data-alca=n] { top: 0; } .aj-caixa [data-alca=s] { bottom: 0; } .aj-caixa [data-alca=e] { right: 0; } .aj-caixa [data-alca=o] { left: 0; }
.aj-caixa [data-alca=n]::after, .aj-caixa [data-alca=s]::after { left: calc(50% - 12px); width: 24px; height: 4px; background: var(--accent); }
.aj-caixa [data-alca=e]::after, .aj-caixa [data-alca=o]::after { top: calc(50% - 12px); width: 4px; height: 24px; background: var(--accent); }
.aj-caixa [data-alca=n]::after { top: 0; } .aj-caixa [data-alca=s]::after { bottom: 0; } .aj-caixa [data-alca=e]::after { right: 0; } .aj-caixa [data-alca=o]::after { left: 0; }
.aj-caixa.travada [data-alca=n], .aj-caixa.travada [data-alca=s], .aj-caixa.travada [data-alca=e], .aj-caixa.travada [data-alca=o] { display: none; }
.aj-linha { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.aj-linha .ico { width: 44px; height: 44px; font-size: 1.25rem; }
.dlg .aj-ang { gap: 2px; text-align: center; }
.aj-ang output { display: inline-block; min-width: 5ch; color: var(--text); font-variant-numeric: tabular-nums; }
.dlg .aj-ang input[type=range] { min-height: 32px; padding: 0; border: 0; background: none; accent-color: var(--accent); }
.aj-props { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }

.dlg textarea { min-height: 64px; padding: 10px 12px; line-height: 1.45; resize: vertical; }

/* De quem é a foto (só admin) */
[data-autor] { display: grid; gap: 10px; }
.nova-pessoa { display: grid; gap: 8px; }
.link-btn { justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--muted); font: 400 .8125rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.pessoas li { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pessoas li:last-child { border-bottom: 0; }
.pessoas .campos { display: grid; gap: 8px; }
.pessoas small { min-width: 0; text-align: left; }
