/* Estação de trabalho no mapa (public/estacao.js): botão no canto de cima à esquerda, painel de personalizar e aviso */
.est { position: absolute; left: 14px; top: calc(12px + var(--sob-palco-lados, 0px)); z-index: 4; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-height: calc(100% - 24px - var(--sob-palco-lados, 0px)); pointer-events: none; }
.est > * { pointer-events: auto; }
.est-chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 11px; border: 1px solid var(--linha); border-radius: 999px; background: var(--painel); color: var(--tinta); font: 600 13px/1 var(--corpo); box-shadow: 0 4px 16px -8px rgba(31, 27, 45, .35); cursor: pointer; }
.est-chip[hidden] { display: none; }
.est-chip svg { width: 18px; height: 18px; color: var(--acento); }
.est-chip:hover, .est-chip[aria-expanded="true"] { background: var(--acento-suave); }
.est-chip:focus-visible, .est-painel button:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

.est-painel { display: flex; flex-direction: column; width: min(360px, calc(100vw - 28px)); min-height: 0; max-height: 100%; border: 1px solid var(--linha); border-radius: 18px; background: var(--painel); color: var(--tinta); box-shadow: 0 12px 40px -14px rgba(31, 27, 45, .45); animation: est-entra .16s ease-out; }
.est-painel[hidden] { display: none; }
@keyframes est-entra { from { opacity: 0; translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .est-painel { animation: none; } }
.est-topo { position: relative; display: grid; gap: 2px; padding: 14px 48px 10px 16px; border-bottom: 1px solid var(--linha); }
.est-topo strong { font: 700 16px/1.2 var(--titulo); }
.est-topo small { color: var(--suave); font-size: 12.5px; }
.est-x { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--suave); cursor: pointer; }
.est-x:hover { background: var(--acento-suave); color: var(--tinta); }
.est-x svg { width: 18px; height: 18px; }
.est-corpo { min-height: 0; overflow-y: auto; padding: 4px 16px 8px; }
.est fieldset { margin: 0; padding: 10px 0 12px; border: 0; border-bottom: 1px solid var(--linha); display: grid; gap: 10px; }
.est fieldset:last-child { border-bottom: 0; }
.est legend { padding: 10px 0 0; font: 600 12px/1 var(--corpo); letter-spacing: .04em; text-transform: uppercase; color: var(--suave); }
.est legend small { margin-left: 6px; font: 500 11px/1 var(--mono); letter-spacing: 0; text-transform: none; }
.est-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.est-linha > span { font-size: 13.5px; }

/* escolhas: segmentos, liga/desliga e cores */
.est-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: var(--fundo); }
.est-seg button, .est-liga button, .est-bichos button, .est-sem { min-height: 32px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--tinta); font: 500 13px/1 var(--corpo); cursor: pointer; }
.est-seg button { flex: 1 1 auto; }
.est-seg button:hover, .est-liga button:hover, .est-bichos button:hover:not([disabled]) { background: var(--hover); }
.est-seg [aria-checked="true"] { background: var(--painel); border-color: var(--linha); font-weight: 600; box-shadow: 0 1px 3px rgba(31, 27, 45, .12); }
.est-num button { min-width: 38px; flex: 0 0 auto; }
.est-liga { display: flex; gap: 6px; }
.est-liga button, .est-sem { border-color: var(--linha); }
.est-liga [aria-pressed="true"], .est-bichos [aria-pressed="true"], .est-bichos [aria-checked="true"], .est-sem[aria-checked="true"] { background: var(--acento-suave); border-color: var(--acento); color: var(--tinta); font-weight: 600; }
.est-cores { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.est-cor { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.est-cor i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(31, 27, 45, .18); }
.est-cor[aria-checked="true"] { border-color: var(--acento); }
.est-bichos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.est-bichos button { display: inline-flex; align-items: center; gap: 7px; border-color: var(--linha); }
.est-bichos i { width: 12px; height: 12px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(31, 27, 45, .2); }
.est-bichos [disabled] { opacity: .45; cursor: not-allowed; }
/* "Pôr na mesa" em partes (Trabalho, Enfeites, Funko Pop, Bichinhos); os chips do tamanho do nome ("Indiana Jones"
   não cabia na grade de 3), cortando com reticências só se um sozinho passar da largura do painel */
.est-sub { margin: 2px 0 -4px; font: 600 12.5px/1.2 var(--corpo); color: var(--tinta); }
.est-sub small { margin-left: 4px; color: var(--suave); font: 500 11px/1 var(--mono); }
.est .est-bichos { display: flex; flex-wrap: wrap; }
.est-bichos button { min-width: 0; max-width: 100%; padding: 0 10px; gap: 6px; }
.est-bichos button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-nota { margin: 0; color: var(--suave); font-size: 12.5px; line-height: 1.4; }
.est-pe { position: relative; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--linha); }
.est-pe button { height: 36px; padding: 0 16px; border: 1px solid var(--linha); border-radius: 10px; background: var(--painel); color: var(--tinta); font: 600 13.5px/1 var(--corpo); cursor: pointer; }
.est-pe .est-salvar { background: var(--acento); border-color: var(--acento); color: var(--no-acento); }
.est-pe button[disabled] { opacity: .5; cursor: default; }
.est-erro { position: absolute; left: 16px; right: 16px; bottom: calc(100% + 6px); margin: 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ruim) 14%, var(--painel)); color: var(--ruim); font-size: 13px; }
.est-erro[hidden] { display: none; }

/* aviso no pé do mapa (cadeira de outra pessoa, ocupada, salvo) */
.est-aviso { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 32px); padding: 9px 14px 9px 11px; border: 1px solid var(--linha); border-radius: 14px; background: var(--painel); color: var(--tinta); font-size: 13.5px; box-shadow: 0 6px 24px -8px rgba(31, 27, 45, .3); pointer-events: none; }
.est-aviso[hidden] { display: none; }
.est-aviso svg { width: 18px; height: 18px; flex: none; color: var(--acento); }

@media (max-width: 520px) {
  .est { left: 10px; }
  .est-bichos { grid-template-columns: repeat(2, 1fr); }
}

/* selos em cima de todas as estações (livre / iniciais do dono) e o cartão da estação clicada */
.est-selos { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.est-selos[hidden] { display: none; }
.est-selo { position: absolute; left: 0; top: 0; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border: 1.5px solid var(--linha); border-radius: 999px; background: var(--painel); color: var(--tinta); font: 600 12px/1 var(--corpo); box-shadow: 0 3px 10px -5px rgba(31, 27, 45, .45); cursor: pointer; pointer-events: auto; }
.est-selo[hidden] { display: none; }
.est-selo b { font-weight: 700; font-size: 10.5px; letter-spacing: .02em; }
.est-selo svg { width: 14px; height: 14px; }
.est-selo.livre { background: color-mix(in srgb, var(--bom) 16%, var(--painel)); border-color: color-mix(in srgb, var(--bom) 55%, var(--linha)); color: var(--bom); }
.est-selo.minha { background: var(--acento-suave); border-color: var(--acento); color: var(--acento); }
.est-selo.atual { outline: 2px solid var(--acento); outline-offset: 2px; }
.est-selo:hover { filter: brightness(.97); }
.est-selo:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

.est-cartao { position: absolute; left: 0; top: 0; z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 264px; max-width: calc(100% - 16px); padding: 12px 14px 12px; border: 1px solid var(--linha); border-radius: 16px; background: var(--painel); color: var(--tinta); box-shadow: 0 12px 34px -14px rgba(31, 27, 45, .5); }
.est-cartao[hidden] { display: none; }
.est-cartao header strong { display: flex; align-items: center; gap: 7px; padding-right: 28px; font: 700 14.5px/1.25 var(--titulo); }
.est-cartao header svg { width: 17px; height: 17px; flex: none; color: var(--acento); }
.est-cartao .est-x { right: 6px; top: 6px; width: 28px; height: 28px; }
.est-cartao > button:not(.est-x) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--linha); border-radius: 10px; background: var(--painel); color: var(--tinta); font: 600 13px/1 var(--corpo); cursor: pointer; }
.est-cartao > button svg { width: 16px; height: 16px; }
.est-cartao > button:hover:not([disabled]) { background: var(--hover); }
.est-cartao > .est-prim { background: var(--acento); border-color: var(--acento); color: var(--no-acento); }
.est-cartao > .est-prim:hover:not([disabled]) { background: var(--acento); filter: brightness(1.06); }
.est-cartao button[disabled] { opacity: .5; cursor: default; }
.est-cartao button:focus-visible, .est-admin select:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.est-cartao .est-erro { position: static; }

/* o bloco do admin (cartão e painel) */
.est-admin { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 2px; padding: 9px 10px; border: 1px dashed color-mix(in srgb, var(--acento) 45%, var(--linha)); border-radius: 12px; }
.est-admin-tag { justify-self: start; padding: 2px 7px; border-radius: 999px; background: var(--acento-suave); color: var(--acento); font: 600 10.5px/1.3 var(--corpo); letter-spacing: .05em; text-transform: uppercase; }
.est-admin label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.est-admin select { flex: 1; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--linha); border-radius: 9px; background: var(--painel); color: var(--tinta); font: 500 13px/1 var(--corpo); }
.est-admin small { color: var(--suave); font-size: 12px; }
.est-corpo > .est-admin { margin: 10px 0 12px; }

/* painel de personalizar: pôr na mesa, a peça escolhida */
.est-por { display: flex; flex-wrap: wrap; gap: 6px; }
.est-por button { min-height: 32px; padding: 0 11px; border: 1px solid var(--linha); border-radius: 9px; background: none; color: var(--tinta); font: 500 13px/1 var(--corpo); cursor: pointer; }
.est-por button:hover:not([disabled]) { background: var(--hover); }
.est-por button small { margin-left: 3px; color: var(--suave); font: 500 11px/1 var(--mono); }
.est-por [disabled] { opacity: .45; cursor: not-allowed; }
.est-liga button { display: inline-flex; align-items: center; gap: 6px; }
.est-liga svg { width: 15px; height: 15px; }
.est-liga .est-perigo { border-color: var(--ruim); color: var(--ruim); }
.est-peca { background: color-mix(in srgb, var(--acento-suave) 55%, transparent); margin: 6px -16px 0; padding-left: 16px !important; padding-right: 16px !important; }
.est-dica { margin: 12px 0 2px; padding: 9px 11px; border-radius: 10px; background: var(--fundo); color: var(--suave); font-size: 12.5px; line-height: 1.4; }
.est-sem { font-size: 12px; }
#mapa.est-editando canvas { cursor: grab; }
#mapa.est-editando.est-sobre canvas { cursor: move; }
#mapa.est-arrastando canvas { cursor: grabbing; }
.est-admin button { justify-self: start; min-height: 30px; padding: 0 10px; border: 1px solid var(--linha); border-radius: 9px; background: var(--painel); color: var(--tinta); font: 500 12.5px/1 var(--corpo); cursor: pointer; }
.est-admin button:hover:not([disabled]) { background: var(--hover); }
#mapa.est-editando #mapa-dica { visibility: hidden; }
