/* A área de trabalho com peças livres: cada uma onde o dono pôs e do tamanho que ele deu, em vidro ou solta.
   No computador as peças têm posição própria; no celular vêm empilhadas (as regras de cosmos.css continuam valendo lá). */

.pc { position: relative; min-width: 0; }
/* só o nome do mês ganha inicial maiúscula; os outros títulos saem como foram escritos */
.pc h3 { text-transform: none; }
.pc .w-mes h3 { text-transform: capitalize; }
.pc > :first-child { height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.pc-tirar, .pc-estilo, .pc-alca { display: none; }
.w-rolo { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-right: -8px; padding-right: 8px; }
.w .w-rolo > h4:first-child, .w-solto .w-rolo > h4:first-child { margin-top: 2px; }

/* peça solta: sem cartão, direto sobre o plano de fundo, com o texto sempre claro */
.w-solto { color: #f5f3ef; text-shadow: 0 1px 18px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .3); padding: 4px 6px; --f: 255, 255, 255; --tinta: #f5f3ef; --tinta-2: rgba(245, 243, 239, .82); --tinta-3: rgba(245, 243, 239, .62); --laranja-claro: var(--marca-clara); }
.w-solto header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.w-solto h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; text-transform: capitalize; }
.w-solto h4 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-3); margin: 14px 0 6px; }
.w.w-relogio { justify-content: center; }
.pc-relogio > :first-child { container-type: size; }
.pc-relogio .w-hora { font-size: min(104px, 28cqw, 64cqh); }
.pc-relogio .w-dia { font-size: min(20px, 5.600cqw, 15cqh); white-space: nowrap; }

/* reuniões */
.w-reuniao { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.w-reuniao + .w-reuniao { border-top: 1px solid rgba(var(--f), .08); }
.w-reuniao-nome { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; padding-left: 10px; border-left: 3px solid color-mix(in srgb, var(--cor, #ff8a3d) 80%, transparent); border-radius: 2px; }
.w-reuniao-nome b { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-reuniao-nome small { font-size: 12.5px; color: var(--tinta-2); }
.w-solto .botao { text-shadow: none; }

/* faixa de medidas: números lado a lado, com um separador vertical que some nas pontas e não encosta nas bordas */
.w.w-faixa, .w-solto.w-faixa { padding: 0; justify-content: center; }
.w-metricas { display: flex; align-items: stretch; width: 100%; height: 100%; text-align: left; }
.w-metrica { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 18px; }
.w-metrica + .w-metrica::before { content: ""; position: absolute; left: 0; top: 16%; bottom: 16%; width: 1px; background: linear-gradient(180deg, rgba(var(--f), 0), rgba(var(--f), .3) 28%, rgba(var(--f), .3) 72%, rgba(var(--f), 0)); }
.w-metrica b { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
.w-metrica small { font-size: 12.5px; color: var(--tinta-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-nivel { display: block; height: 4px; margin-top: 7px; border-radius: 99px; overflow: hidden; background: rgba(var(--f), .16); }
.w-nivel i { display: block; width: var(--p); height: 100%; border-radius: inherit; background: var(--laranja); transition: width .6s var(--ease-out); }
.w-nivel.alto i { background: #ff5a4e; }

/* a bandeja do modo de edição */
.mesa-bandeja { position: fixed; z-index: 30; left: 50%; bottom: 104px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 10px; border-radius: 12px; animation: mesa-bandeja .3s var(--ease-out) both; }
.mesa-bandeja .espaco { flex: none; width: 10px; }
@keyframes mesa-bandeja { from { opacity: 0; transform: translate(-50%, 14px); } }
:root[data-tema="claro"] .mesa-bandeja { color-scheme: light; color: var(--tinta); --f: 0, 0, 0; --tinta: #1d1d1f; --tinta-2: rgba(29, 29, 31, .76); --brilho: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 0 0 1px rgba(0, 0, 0, .07); }

@media (min-width: 861px) {
  .mesa { display: block; padding: 0; }
  .pc { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); }
  /* a escala do canto: o conteúdo inteiro cresce ou diminui por igual (texto, espaços e desenho) */
  .pc > :first-child { zoom: var(--z, 1); }
  /* editar: a peça ganha contorno, o botão de tirar, o de estilo e a alça do canto */
  .mesa.editando .pc { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
  .mesa.editando .pc > :first-child { pointer-events: none; }
  .mesa.editando .pc::after { content: ""; position: absolute; inset: -4px; border-radius: 14px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .5); pointer-events: none; }
  .mesa.editando .pc.pegando { cursor: grabbing; z-index: 3; }
  .mesa.editando .pc.pegando::after { box-shadow: 0 0 0 1.5px var(--laranja); }
  .mesa.editando .pc-tirar { display: grid; place-items: center; position: absolute; z-index: 2; top: -14px; left: calc(50% - 44px); width: 24px; height: 24px; border-radius: 50%; color: #1d1d1f; background: rgba(245, 245, 247, .96); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
  .mesa.editando .pc-estilo { display: block; position: absolute; z-index: 2; top: -14px; left: calc(50% - 14px); height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 600; color: #1d1d1f; background: rgba(245, 245, 247, .96); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
  /* a linha do ímã: aparece só enquanto a peça está presa num alinhamento */
  .mesa-guia { position: absolute; z-index: 4; pointer-events: none; background: rgba(255, 255, 255, .5); }
  .mesa-guia.v { top: 0; bottom: 0; width: 1px; }
  .mesa-guia.h { left: 0; right: 0; height: 1px; }
  /* os quatro cantos mudam a peça inteira por igual; os dois lados mudam só a largura */
  .mesa.editando .pc-alca { display: block; position: absolute; z-index: 2; }
  .mesa.editando .pc-canto { width: 22px; height: 22px; }
  .mesa.editando .pc-se { right: -9px; bottom: -9px; cursor: nwse-resize; border-radius: 0 0 12px 0; box-shadow: inset -3px -3px 0 rgba(255, 255, 255, .92); }
  .mesa.editando .pc-nw { left: -9px; top: -9px; cursor: nwse-resize; border-radius: 12px 0 0 0; box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .92); }
  .mesa.editando .pc-ne { right: -9px; top: -9px; cursor: nesw-resize; border-radius: 0 12px 0 0; box-shadow: inset -3px 3px 0 rgba(255, 255, 255, .92); }
  .mesa.editando .pc-sw { left: -9px; bottom: -9px; cursor: nesw-resize; border-radius: 0 0 0 12px; box-shadow: inset 3px -3px 0 rgba(255, 255, 255, .92); }
  .mesa.editando .pc-lado { top: calc(50% - 20px); width: 14px; height: 40px; cursor: ew-resize; }
  .mesa.editando .pc-lado::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 5px; width: 4px; border-radius: 2px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
  .mesa.editando .pc-e { right: -11px; }
  .mesa.editando .pc-w { left: -11px; }
  body.editando-mesa .dock { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }
  body.editando-mesa .mesa-bandeja { bottom: 22px; }
  body.editando-mesa .janela { opacity: 0; pointer-events: none; }
}
@media (max-width: 860px) {
  .pc > :first-child { height: auto; overflow: visible; }
  .pc-mes, .pc-vps { display: none; }
  .w-rolo { overflow: visible; }
  .mesa-bandeja { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mesa-bandeja { animation: none; } .w-nivel i { transition: none; } }
/* a regra antiga escondia o mês em janela média; com peças livres, quem decide é o dono */
@media (min-width: 861px) { .pc .w-mes { display: flex; } }
