@font-face { font-family: "Archivo"; src: url(fontes/archivo-bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(fontes/figtree-regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(fontes/figtree-semibold.ttf) format("truetype"); font-weight: 600; font-display: swap; }

/* Cores das propostas Helplar (navy e laranja). A interface é vidro escuro sobre a imagem, igual nos dois temas. */
:root {
  --ink: #15263F;
  --vidro: rgba(15, 26, 44, 0.72);
  --vidro-forte: rgba(15, 26, 44, 0.86);
  --texto: #F4F3EF;
  --texto-suave: rgba(244, 243, 239, 0.72);
  --texto-fraco: rgba(244, 243, 239, 0.5);
  --linha: rgba(244, 243, 239, 0.16);
  --laranja: #EC8123;
  --fundo: #0E1623;
  --raio: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --vidro: rgba(12, 20, 34, 0.76); --fundo: #0B121D; }
}
:root[data-theme="dark"] { --vidro: rgba(12, 20, 34, 0.76); --fundo: #0B121D; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--fundo); color: var(--texto);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#gl.a-arrastar { cursor: grabbing; }

/* barra de cima */
.topo { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 18px;
  padding: 14px max(18px, env(safe-area-inset-right)) 28px max(18px, env(safe-area-inset-left));
  background: linear-gradient(rgba(8, 14, 24, 0.62), rgba(8, 14, 24, 0)); pointer-events: none; }
.topo > * { pointer-events: auto; }
.marca { display: flex; align-items: center; gap: 11px; min-width: 0; }
.marca img { width: 34px; height: 34px; object-fit: contain; }
.marca-t { display: flex; flex-direction: column; line-height: 1.15; }
.marca-t b { font-family: "Archivo"; font-size: 15px; letter-spacing: 0.01em; }
.marca-t span { font-size: 12px; color: var(--texto-suave); }

.niveis { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border-radius: 999px; background: var(--vidro);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--linha); }
.niveis button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--texto-suave); display: flex; align-items: center; gap: 7px;
  transition: background 0.2s, color 0.2s; }
.niveis button:hover { color: var(--texto); }
.niveis button[aria-pressed="true"] { background: var(--texto); color: var(--ink); }
.niveis .rec { width: 6px; height: 6px; border-radius: 50%; background: var(--laranja); }
.niveis.comparando button { opacity: 0.4; pointer-events: none; }

.acoes { display: flex; gap: 8px; }
.alterna, .icone { border: 1px solid var(--linha); background: var(--vidro); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
  font-weight: 600; color: var(--texto); transition: background 0.2s, border-color 0.2s; }
.alterna[aria-pressed="true"] { border-color: rgba(236, 129, 35, 0.9); }
.alterna:disabled { opacity: 0.45; cursor: default; }
a.alterna { text-decoration: none; display: inline-flex; align-items: center; }
.alterna.destaque { border-color: rgba(236, 129, 35, 0.9); background: rgba(236, 129, 35, 0.2); }
.icone { padding: 7px; display: grid; place-items: center; }
.icone svg, .pega svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

/* painel da divisão e planta */
.lado { position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: 54px; z-index: 4; width: 330px;
  display: flex; flex-direction: column; gap: 10px; }
.cartao { background: var(--vidro); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px 18px; }
.sobre { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--laranja); }
.info h1 { margin: 0 0 12px; font-family: "Archivo"; font-size: 24px; letter-spacing: -0.015em; line-height: 1.1; }
.info dl { margin: 0; display: grid; gap: 10px; max-height: 34vh; overflow: auto; }
.info dt { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--texto-fraco);
  margin-bottom: 2px; }
.info dd { margin: 0; font-size: 14px; line-height: 1.4; color: var(--texto); }
.info dd + dd { margin-top: 4px; }
.info dd b { font-weight: 600; color: var(--texto-suave); margin-right: 5px; }

/* kitnets e divisões */
.grupos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 5px; }
.grupos button { border: 0; background: transparent; border-radius: 10px; padding: 6px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--texto-suave); transition: background 0.2s, color 0.2s; }
.grupos button b { font-family: "Archivo"; font-size: 15px; letter-spacing: 0.01em; }
.grupos button span { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.grupos button:hover { color: var(--texto); }
.grupos button[aria-pressed="true"] { background: var(--texto); color: var(--ink); }
.salas { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.salas:empty { display: none; }
.salas button { border: 1px solid var(--linha); background: transparent; border-radius: 999px; padding: 4px 11px;
  font-size: 12.5px; font-weight: 600; color: var(--texto-suave); cursor: pointer; }
.salas button:hover { color: var(--texto); border-color: rgba(244, 243, 239, 0.4); }
.salas button[aria-pressed="true"] { color: var(--texto); border-color: var(--laranja); }
.rot-opcao { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--texto-fraco); }

.planta { padding: 10px; }
#planta { width: 100%; height: auto; display: block; }
#planta .div { fill: rgba(244, 243, 239, 0.08); stroke: none; cursor: pointer; transition: fill 0.2s; }
#planta .div:hover { fill: rgba(244, 243, 239, 0.18); }
#planta .div.atual { fill: rgba(236, 129, 35, 0.2); }
#planta .div.sem { cursor: default; }
#planta .div.sem:hover { fill: rgba(244, 243, 239, 0.08); }
#planta .parede { fill: rgba(244, 243, 239, 0.78); }
#planta .ponto { fill: rgba(244, 243, 239, 0.8); cursor: pointer; }
#planta .ponto.atual { fill: var(--laranja); }
#planta .cone { fill: rgba(236, 129, 35, 0.32); stroke: none; pointer-events: none; }
#planta text { font-size: 0.34px; fill: var(--texto-suave); pointer-events: none; font-weight: 600; }

.ampliar { margin-top: 8px; width: 100%; border: 1px solid var(--linha); background: transparent; color: var(--texto);
  padding: 7px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ampliar:hover { border-color: rgba(236, 129, 35, 0.9); }

/* planta calculada de cima, em ecrã inteiro */
.planta-grande { position: fixed; inset: 0; z-index: 8; background: rgba(8, 13, 22, 0.94); display: flex; flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  gap: 12px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.planta-grande[hidden] { display: none; }
.pg-topo { display: flex; justify-content: space-between; align-items: flex-start; }
.pg-topo h2 { margin: 0; font-family: "Archivo"; font-size: 24px; letter-spacing: -0.015em; }
.pg-quadro { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.pg-quadro img { max-width: 100%; max-height: 100%; border-radius: 10px; display: block; }
#pg-pontos { position: absolute; pointer-events: none; }
#pg-pontos button { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; border: 0; cursor: pointer;
  background: transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; }
#pg-pontos i { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--laranja);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.45); }
#pg-pontos button.atual i { background: var(--laranja); }
#pg-pontos span { font-size: 12px; font-weight: 600; color: #fff; background: rgba(15, 26, 44, 0.78); padding: 3px 8px;
  border-radius: 999px; white-space: nowrap; }
.pg-nota { margin: 0; color: var(--texto-fraco); font-size: 12.5px; text-align: center; }

/* passagens para as divisões ao lado */
#pontos { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.passagem { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; border: 0;
  background: transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; }
.passagem .anel { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(15, 26, 44, 0.35); box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35); display: grid; place-items: center;
  transition: transform 0.2s, background 0.2s; }
.passagem .anel::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.passagem:hover .anel { transform: scale(1.12); background: rgba(236, 129, 35, 0.55); }
.passagem span { font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(15, 26, 44, 0.66); padding: 4px 10px;
  border-radius: 999px; white-space: nowrap; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* comparação lado a lado */
#divisor { position: fixed; top: 0; bottom: 0; width: 0; z-index: 3; pointer-events: none; }
#divisor .linha { position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35); }
#divisor .pega { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 46px; height: 46px;
  border-radius: 50%; border: 2px solid #fff; background: var(--vidro-forte); display: grid; place-items: center;
  cursor: ew-resize; pointer-events: auto; touch-action: none; }
#rotulos-comparar { position: fixed; top: 76px; left: 0; right: 0; z-index: 4; pointer-events: none; }
#rotulos-comparar .rot { position: absolute; pointer-events: auto; border: 1px solid var(--linha); background: var(--vidro-forte);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 14px; cursor: pointer; }
#rotulos-comparar .rot::after { content: " \25BE"; color: var(--laranja); }
#rotulos-comparar .esq { transform: translateX(calc(-100% - 14px)); }
#rotulos-comparar .dir { transform: translateX(14px); }

/* rodapé */
.rodape { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: space-between;
  gap: 18px; align-items: center; padding: 26px max(18px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: linear-gradient(rgba(8, 14, 24, 0), rgba(8, 14, 24, 0.6)); pointer-events: none; font-size: 12.5px; }
#resumo-nivel { color: var(--texto); font-weight: 600; }
.nota { color: var(--texto-fraco); text-align: right; }

/* carregamento */
.carregar { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 12px;
  background: var(--fundo); transition: opacity 0.6s; }
.carregar img { width: 56px; height: 56px; object-fit: contain; }
.carregar p { margin: 0; color: var(--texto-suave); font-size: 14px; letter-spacing: 0.02em; }
.carregar .barra, .progresso { height: 2px; background: var(--linha); overflow: hidden; }
.carregar .barra { width: 160px; border-radius: 2px; }
.carregar i, .progresso i { display: block; height: 100%; width: 0; background: var(--laranja); transition: width 0.25s; }
.carregar.fora { opacity: 0; pointer-events: none; }
.progresso { position: fixed; top: 0; left: 0; right: 0; z-index: 6; opacity: 0; transition: opacity 0.3s; }
.progresso.ativo { opacity: 1; }
.aviso { position: fixed; inset: auto 20px 50% 20px; z-index: 11; text-align: center; font-size: 16px; }

/* telemóvel: painel em baixo, planta pequena */
@media (max-width: 760px) {
  .topo { flex-wrap: wrap; gap: 10px; padding: 10px 16px 22px; }
  .marca-t span { display: none; }
  .niveis { order: 3; width: 100%; justify-content: space-between; margin: 0; }
  .niveis button { flex: 1; justify-content: center; padding: 8px 6px; font-size: 13px; }
  .acoes { margin-left: auto; }
  #bt-ecra { display: none; }
  .lado { left: 16px; right: 16px; width: auto; bottom: 40px; flex-direction: row; align-items: flex-end; }
  .info { flex: 1; padding: 12px 14px; }
  .info h1 { font-size: 19px; margin-bottom: 6px; }
  .info dl { max-height: 22vh; }
  .info dd { font-size: 13px; }
  .planta { width: 112px; flex: none; padding: 6px; }
  .lado { flex-wrap: wrap; }
  .grupos { order: -1; width: 100%; flex: none; }
  .salas { margin-bottom: 6px; }
  .rot-opcao { display: none; }
  .nota { display: none; }
  .rodape { padding: 12px 16px max(10px, env(safe-area-inset-bottom)); }
  #rotulos-comparar { top: 118px; }
}

/* versão do site (html.protegida): marca de água, menu de direitos no botão direito, bloqueio fora de casa */
.protegida #gl, .protegida img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.marca-agua { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: 50px; z-index: 4; display: flex;
  align-items: center; gap: 8px; pointer-events: none; user-select: none; opacity: 0.62; color: #fff;
  font-family: "Archivo"; font-size: 11px; letter-spacing: 0.22em; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55); }
.marca-agua img { width: 21px; height: auto; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.45)); }
.menu-direitos { position: fixed; z-index: 12; width: 290px; padding: 14px 16px 15px; border-radius: 12px;
  background: var(--vidro-forte); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--linha); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); font-size: 13px; line-height: 1.45; }
.menu-direitos[hidden] { display: none; }
.md-marca { margin: 0 0 6px; display: flex; align-items: center; gap: 9px; font-family: "Archivo"; font-size: 14px; }
.md-marca img { width: 20px; height: auto; }
.md-texto { margin: 0 0 10px; color: var(--texto-suave); }
.md-link { color: var(--laranja); font-weight: 600; text-decoration: none; }
.md-link:hover { text-decoration: underline; }
.bloqueio { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 24px; text-align: center; background: var(--fundo); }
.bloqueio img { width: 60px; height: auto; }
.bloqueio h1 { margin: 6px 0 0; font-family: "Archivo"; font-size: 24px; letter-spacing: -0.01em; }
.bloqueio p { margin: 0; color: var(--texto-suave); font-size: 15px; }
.bloqueio a { margin-top: 10px; padding: 11px 20px; border-radius: 999px; background: var(--laranja); color: #fff;
  font-weight: 600; font-size: 14px; text-decoration: none; }
@media (max-width: 760px) {
  .marca-agua { bottom: auto; top: calc(112px + env(safe-area-inset-top)); right: 16px; font-size: 10px; }
  .marca-agua img { width: 17px; }
}

/* 1105: dois espaços (casa e loja) e rótulos fixos do dia e do fim do dia na comparação */
.grupos { grid-template-columns: repeat(2, 1fr); }
.grupos button b { font-size: 14px; }
#rotulos-comparar .rot { pointer-events: none; cursor: default; }
#rotulos-comparar .rot::after { content: none; }
[hidden] { display: none !important; }
