/* ===== Telas ===== */

/* 1 · Entrada (blueprint v0.25, issue #18): uma cena, uma frase, uma ação, três sinais. Cabe numa tela de celular sem rolar. */
.entry { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 16px; padding: 14px 18px 22px }
/* A cena: 8 s por ciclo (o gesto, Ui::GestureComponent, usa o mesmo --loop). Dedo contorna 6–34 %, a data some 44–52 %,
   o Antes/Depois varre 38–50 %, os ✓ das miniaturas entram aos 56 %; tudo volta aos 90–100 % para recomeçar. */
.e2scene { --loop: 8s; display: grid; gap: 0 }
/* No celular a Entrada cabe sem rolar: a cena fica com a altura que sobra (no mínimo 96 px) e encolhe sem deformar
   (a foto 4:3 mais a tira medem a largura + 18 px de altura). */
@container app (max-width: 699px) {
  .entry { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 14px }
  .drop { gap: 10px }
  .e2scene { flex: 1 1 auto; min-height: 96px; container-type: size; align-content: center; justify-items: center }
  .e2scene > * { width: min(100%, calc(100cqh - 18px)) }
}
.ba { margin: 0; display: block }
.ba .photo { width: 100%; cursor: ew-resize; aspect-ratio: 4/3; touch-action: pan-y } /* o dedo rola a página; o comparador fica na horizontal */
.ba .photo > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block }
.ba .photo .before > .inner { position: absolute; inset: 0 }
.ba .photo .before svg { width: 100%; height: 100%; display: block }
.ba .handrail { position: absolute; inset: 0; pointer-events: none; z-index: 3 }
@property --c { syntax: "<percentage>"; inherits: true; initial-value: 50% }
/* O vai-e-vem sozinho só com transform (o navegador anima sem recalcular a página): a janela do "antes" anda para a
   esquerda, o conteúdo anda o mesmo para a direita (fica parado na tela), e o trilho da alça acompanha a janela.
   Quando a pessoa pega (.touched), volta o corte por --c do compare_controller. */
.ba .photo.cmp:not(.touched) .before { clip-path: none; overflow: hidden; animation: e2win var(--loop) ease-in-out infinite }
.ba .photo.cmp:not(.touched) .before > .inner { animation: e2winIn var(--loop) ease-in-out infinite }
.ba .photo.cmp:not(.touched) .handrail { animation: e2win var(--loop) ease-in-out infinite }
.ba .photo.cmp:not(.touched) .handle { left: 100% }
@keyframes e2win { 0%, 38% { transform: none } 50%, 84% { transform: translateX(-100%) } 96%, 100% { transform: none } }
@keyframes e2winIn { 0%, 38% { transform: none } 50%, 84% { transform: translateX(100%) } 96%, 100% { transform: none } }
/* Fora de vista, a cena para (guide_controller põe .paused). */
.e2scene.paused, .e2scene.paused * { animation-play-state: paused !important }
.e2scene .o-selo { animation: demoMark var(--loop) infinite } /* só opacidade: escala e desfoque no SVG recalculavam a página a cada quadro */
.e2scene .e2th:nth-child(2) .o-selo { animation-delay: .3s } .e2scene .e2th:nth-child(3) .o-selo { animation-delay: .6s }
@keyframes demoMark { 0%, 44% { opacity: 1 } 52%, 90% { opacity: 0 } 97%, 100% { opacity: 1 } }
.e2strip { margin-top: 8px; display: flex; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; position: relative; z-index: 2 }
.e2th { position: relative; flex: 1; aspect-ratio: 4/3; border-radius: 7px; overflow: hidden; min-width: 0 }
.e2th svg { display: block; width: 100%; height: 100% }
.e2th i { position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; transform: scale(0); animation: e2tick var(--loop) infinite }
.e2th i .ic { width: 11px; height: 11px; stroke-width: 3.4 }
.e2th:nth-child(2) i { animation-delay: .3s } .e2th:nth-child(3) i { animation-delay: .6s }
@keyframes e2tick { 0%, 50% { transform: scale(0) } 56% { transform: scale(1.2) } 60%, 88% { transform: scale(1) } 94%, 100% { transform: scale(0) } }
/* Cancelar o envio: discreto, no corpo do Envio (o ‹ Início e o Voltar fazem o mesmo, com Desfazer). */
.cancelup { justify-self: start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--ink2); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 2px; min-height: 40px; cursor: pointer }
.cancelup .ic { width: 16px; height: 16px }
.e2head { margin: 0; display: grid; gap: 6px }
.e2head h1 { font-size: 28px; line-height: 1.08; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; margin: 0 }
.e2head p { margin: 0; font-size: 16px; line-height: 1.35; color: var(--ink2); text-wrap: balance }
/* O botão com ele em cima: espia da borda de cima, atrás do botão (aparecem os olhos e o topete, nunca o texto coberto). */
.ctaw { position: relative; display: grid; margin-top: 26px }
.ctaw .btn { position: relative; z-index: 1 }
.ctaw .spy { left: 22px; bottom: calc(100% - 1px); z-index: 0 }
html[data-espiando="desligado"] .ctaw { margin-top: 0 }
.e2fmt { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 9px; font-size: 13px; line-height: 1.3; color: var(--ink2) }
.e2fmt span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap }
.e2fmt .ic { width: 13px; height: 13px; flex: none }
.drop { display: grid; gap: 14px; align-content: center; border-radius: 18px; transition: background .15s, border-color .15s }
.drop.over { background: var(--tint); border-color: var(--accent) }
.drop .or { display: none; color: var(--ink2); font-size: 14px; text-align: center }
.sigs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.sig { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; padding: 7px 11px 7px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface) }
.sig .ic { width: 17px; height: 17px; color: var(--accent) }
.legal { margin: 0; text-align: center; font-size: 13px; color: var(--ink2) }
.legal a { color: inherit }
@media (prefers-reduced-motion: reduce) {
  .ba .photo.cmp { --c: 0% }
  .ba .photo.cmp:not(.touched) .before { animation: none; overflow: visible; clip-path: inset(0 calc(100% - var(--c)) 0 0) }
  .ba .photo.cmp:not(.touched) .before > .inner, .ba .photo.cmp:not(.touched) .handrail { animation: none }
  .ba .photo.cmp:not(.touched) .handle { left: var(--c) }
  .e2scene .o-selo { animation: demoMarkRm var(--loop) linear infinite }
  .e2th i { animation: none; transform: scale(1) }
}
@keyframes demoMarkRm { 0%, 44% { opacity: 1 } 52%, 100% { opacity: 0 } }
@container app (min-width: 700px) {
  .entry { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 28px 44px; padding: 32px max(44px, 6cqw); max-width: 1180px; margin: 0 auto; width: 100% }
  .e2head h1 { font-size: 34px }
  .drop { border: 2px dashed var(--line); padding: 26px; background: var(--surface) }
  .drop .or { display: block }
}

/* 2 · Envio */
.up { flex: 1; min-height: 0; display: flex; flex-direction: column }
.uphead { padding: 14px 16px 8px; display: grid; gap: 8px }
.uphead strong { font-family: var(--f-display); font-size: 19px; display: flex; align-items: center; gap: 8px }
.uphead strong .ic { color: var(--good) }
.uphead .trk { position: relative; height: 31px; margin-bottom: -6px } /* o Espiando segura o trilho do envio e anda com a ponta real */
.grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px 16px 16px; align-content: start }
.upfoot { padding: 0 16px 14px; display: grid; gap: 10px }
.upacts { display: flex; gap: 8px; flex-wrap: wrap }
.upacts .btn { flex: 1 1 auto }
.upacts .btn.pri { flex: 2 1 auto }
@container app (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 8px 24px 20px }
  .uphead { padding: 18px 24px 8px }
  .upfoot { padding: 0 24px 18px; grid-template-columns: 1fr auto; align-items: center }
}

/* 3–5 · Seleção, Apagando, Resultado */
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "head" "stage" "strip" "bar" }
.head { grid-area: head; display: flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: 48px; font-weight: 700; font-size: 15px; flex-wrap: wrap }
.head .ic { color: var(--accent) }
.head .ok { color: var(--good) }
.head .xs { font-weight: 500; color: var(--ink2); font-size: 14px }
.excs { display: flex; gap: 6px; flex-wrap: wrap; width: 100% }
.exc { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 11px 5px 9px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); text-decoration: none }
.exc .ic { width: 15px; height: 15px }
.exc.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-bg) }
.exc u { text-decoration: none; color: var(--accent) }
.strip { grid-area: strip; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line) }
.strip .tile { width: 68px }
@container app (min-width: 700px) {
  .work { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "stage head" "stage strip" "stage bar" }
  .head { border-left: 1px solid var(--line); background: var(--surface); align-content: center; padding: 14px 16px }
  .strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; overflow-y: auto; overflow-x: hidden; border-top: 0; border-left: 1px solid var(--line); padding: 4px 16px 16px }
  .strip .tile { width: auto }
  .bar { border-left: 1px solid var(--line); flex-wrap: wrap }
}

/* /componentes */
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 10px; min-width: 0 }
.cat h2 { font-family: ui-monospace, monospace; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between }
.cat h2 small { color: var(--ink2); font-weight: 400 }
.cat .bar { grid-area: auto; border: 1px solid var(--line); border-radius: 12px; min-height: 0 }
.cat .toast { animation: none }
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px }
.cat-grid figure { margin: 0; display: grid; gap: 4px; justify-items: center; font-size: 11px; color: var(--ink2) }

/* ---------- Equipe ---------- */
.tbadge { width: 44px; height: 44px; border-radius: 13px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 16px; flex: none }
.tbadge.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 13px }
.tbadge.xl { width: 88px; height: 88px; border-radius: 26px; font-size: 32px }
.tbadge.alt { background: var(--ink2); color: var(--bg) }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--pc, var(--accent)); color: #fff; font-weight: 700; font-size: 12px; flex: none }
.av.xs { width: 24px; height: 24px; font-size: 9px }
.av.pend { background: var(--surface2); color: var(--ink2) }
.av .ic { width: 16px; height: 16px }
.team .thead { display: flex; align-items: center; gap: 12px }
.team .thead h2 { flex: 1; min-width: 0 }
.tmeter { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface) }
.tmeter .big { font-family: var(--f-display); font-size: 48px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums }
.tmeter .big.warn { color: var(--warn) } .tmeter .big.bad { color: var(--bad) }
.tmeter small { color: var(--ink2); font-size: 14px }
.tbar { display: flex; gap: 2px; height: 10px; border-radius: 5px; background: var(--surface2); overflow: hidden }
.tbar i { display: block; height: 100%; background: var(--pc) }
.sline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; padding: 8px 10px; border-radius: 12px; font-size: 14px; font-weight: 600; min-height: 44px }
.sline > span:not(.av, .spin) { flex: 1; min-width: 0 } /* o texto cresce; o avatar e o indicador de espera, não */
.sline.warn { background: var(--warn-bg) } .sline.warn > .ic { color: var(--warn) }
.sline.bad { background: var(--bad-bg) } .sline.bad > .ic { color: var(--bad) }
.sline.good { background: var(--good-bg) } .sline.good > .ic { color: var(--good) }
.sline.info { background: var(--tint) }
.people { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden }
.people > li + li { border-top: 1px solid var(--line) }
.pp { display: grid; grid-template-columns: 36px minmax(0, 1fr) 72px auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; list-style: none; cursor: default }
summary.pp { cursor: pointer }
summary.pp::-webkit-details-marker { display: none }
.pp .nm { font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0 }
.pp .nm .ic { width: 16px; height: 16px; color: var(--ink2) }
.pp b { text-align: right; font-variant-numeric: tabular-nums }
.pp.pend .nm { color: var(--ink2) }
.mini { height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden }
.mini i { display: block; height: 100%; background: var(--pc) }
.mini.full i { background: var(--warn) }
.ppanel { display: grid; gap: 10px; padding: 4px 14px 14px }
.limlab { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink2) }
.limlab .ic { width: 16px; height: 16px }
.lims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px }
.lims .button_to button { width: 100%; min-height: 44px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; font-weight: 700; cursor: pointer }
.lims .button_to button[aria-pressed="true"] { border-color: var(--accent); background: var(--tint) }
.btn.danger { color: var(--bad); border-color: transparent; background: transparent }
.tfoot .invform { display: grid; gap: 8px }
.tfoot .invform input { font: inherit; min-height: 48px; border: 1.5px solid var(--edge); border-radius: 12px; padding: 0 12px; background: var(--surface); color: var(--ink) }
.invcard { margin: 0; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface2) }
.invcard figcaption { display: grid; min-width: 0 }
.invcard .mono { color: var(--ink2) }
.irules { display: flex; justify-content: center; gap: 18px; margin: 0; color: var(--ink2); font-size: 15px }
.irules span { display: inline-flex; align-items: center; gap: 6px }
.wsw { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface2) }
.wsw .button_to button { width: 100%; min-height: 56px; border: 2px solid transparent; border-radius: 12px; background: transparent; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink2); font-family: var(--f-display); font-weight: 800; font-size: 20px; cursor: pointer; font-variant-numeric: tabular-nums }
.wsw .button_to button[aria-pressed="true"] { background: var(--surface); border-color: var(--accent); color: var(--ink) }
.wsw small { font-family: var(--f-body); font-size: 12px; font-weight: 700 }
.teamrow { display: grid; gap: 8px }
.teamnew { border: 1.5px dashed var(--accent); background: var(--tint); border-radius: 14px }
.seatsmini { display: inline-flex; align-items: center }
.seatsmini i { width: 20px; height: 20px; border-radius: 50%; border: 2px dashed var(--accent); margin-left: -6px; background: var(--bg) }
.seatsmini i:first-child { margin-left: 0 }
.invite { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 18px }
.invite .mid { flex: 1; display: grid; justify-items: center; align-content: center; gap: 16px; text-align: center }
.invite h2 { font-size: 28px }
.invite .who { margin: 0; color: var(--ink2) }
.ibadge.dim { opacity: .45 }
.learn { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px }
.learn > div { flex: 1; display: grid; justify-items: center; gap: 4px; font-size: 13px; color: var(--ink2) }
.learn .k { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink) }
.learn .k.o { background: var(--surface); border: 2px solid var(--accent); color: var(--accent) }
.learn .from { opacity: .55; text-decoration: line-through }
.learn .ar { color: var(--accent) }
.ifoot { display: grid; gap: 4px; width: 100%; max-width: 420px; margin: 0 auto }
.fitbar { display: grid; grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 4px }
.fitbar i { height: 26px; border-radius: 6px; background: var(--accent) }
.fitbar i.no { background: transparent; border: 2px dashed var(--edge) }
.chg { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--surface) }
.period { display: grid; gap: 6px }
.pbar { display: flex; height: 22px; border-radius: 8px; overflow: hidden; background: var(--surface2) }
.pbar i { display: block; height: 100% }
.pused { background: repeating-linear-gradient(135deg, var(--surface2) 0 6px, var(--line) 6px 8px) }
.pleft { flex: 1; background: var(--tint); display: grid !important; place-items: center }
.pleft span { font: 700 11px var(--f-mono); color: var(--accent) }
.plabs { display: flex; justify-content: space-between; font: 600 11px var(--f-mono); color: var(--ink2) }
.plabs span { display: inline-flex; align-items: center; gap: 3px }
.plabs .ic, .crow .ic { width: 13px; height: 13px }
.crow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px }
.crow .when { width: 64px; display: inline-flex; align-items: center; gap: 4px; font: 600 12px var(--f-mono); color: var(--ink2) }
.crow b { font-family: var(--f-display); font-size: 20px; font-variant-numeric: tabular-nums }
.crow > span:last-child { color: var(--ink2); font-size: 13px; font-weight: 600 }
@media (prefers-reduced-motion: no-preference) {
  .people > li { animation: slideup .25s var(--ease-out) both }
}
label.plan:has(input:checked) { border-color: var(--accent); background: var(--tint); box-shadow: inset 0 0 0 1px var(--accent) }
label.plan:has(input:checked) .rad { border-color: var(--accent) }
label.plan:has(input:checked) .rad::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent) }
a.plan { text-decoration: none; color: inherit }
