/* ============================================================
   Centro de aprendizado — a linguagem visual, no Owner
   ------------------------------------------------------------
   Mesma casa da página pública: escuro violeta saturado no
   trilho, papel claro na bancada, Space Grotesk nos títulos e
   JetBrains Mono nas etiquetas.

   Nada de ícone de biblioteca (os desenhos vivem em lib/help.ts),
   nada de pastel, e lista corrida com divisória quase invisível
   em vez de cartão flutuante.
   ============================================================ */

.hp {
  --breu: #0b0620;
  --breu-2: #130b31;
  --casca: #1d1147;

  --roxo: #5f31d6;
  --roxo-forte: #45209f;
  --roxo-claro: #8f6bf1;
  --ciano: #15c5c5;

  --papel: #ffffff;
  --papel-2: #f5f4fb;
  --papel-3: #ece9f8;
  --tinta: #16112b;
  --tinta-2: #4b4568;
  --tinta-3: #8b85a8;
  --filete: #e4e0f2;

  --azul: #2f9bf0;
  --esmeralda: #14c78d;
  --ambar: #f79c2d;
  --rosa: #f0526e;

  --fonte-titulo: var(--fonte-help-titulo), "Space Grotesk", system-ui, sans-serif;
  --fonte-mono: var(--fonte-help-mono), "JetBrains Mono", ui-monospace, monospace;
}

.hp-display {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}

/* A etiqueta em mono antes de cada título. É o que faz a tela parecer manual
   e não blog, e é o único resto da metáfora de oficina. */
.hp-chapa {
  font-family: var(--fonte-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hp-mono { font-family: var(--fonte-mono); }

/* Grão: sem isso o escuro fica plástico de template. */
.hp-grao::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23r)'/%3E%3C/svg%3E");
}

/* -------------------------------------------------- o quadro */

.hp-quadro { display: grid; grid-template-columns: 262px minmax(0, 1fr); min-height: 100vh; background: var(--papel-2); }

.hp-rail {
  position: relative;
  background: linear-gradient(178deg, var(--breu) 0%, #150c36 100%);
  color: #fff;
  padding: 22px 16px 26px;
  overflow: hidden;
}
.hp-rail-marca { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.hp-selo {
  font-family: var(--fonte-mono);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 6px;
  background: rgba(143, 107, 241, 0.22); color: #cbb6ff;
  box-shadow: inset 0 0 0 1px rgba(143, 107, 241, 0.4);
}

.hp-grupo { margin-top: 18px; }
.hp-grupo > .hp-chapa {
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 9px; font-size: 9px; color: rgba(255, 255, 255, 0.34);
}
.hp-grupo > .hp-chapa::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.1); }

.hp-item {
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: rgba(255, 255, 255, 0.62); text-decoration: none;
}
.hp-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.hp-item[data-ativo="1"] {
  background: linear-gradient(90deg, rgba(95, 49, 214, 0.55), rgba(95, 49, 214, 0.14));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(143, 107, 241, 0.4);
}
.hp-item .hp-n {
  margin-left: auto; font-family: var(--fonte-mono);
  font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.4);
}
.hp-item[data-ativo="1"] .hp-n { color: #cbb6ff; }

.hp-alerta {
  margin-top: 22px; padding: 14px; border-radius: 13px;
  background: rgba(240, 82, 110, 0.14);
  box-shadow: inset 0 0 0 1px rgba(240, 82, 110, 0.35);
}
.hp-alerta .hp-chapa { color: #ff92a7; font-size: 9px; }
.hp-alerta b { display: block; margin-top: 6px; font-family: var(--fonte-titulo); font-size: 26px; letter-spacing: -0.04em; }
.hp-alerta p { margin: 2px 0 10px; font-size: 12px; color: rgba(255, 255, 255, 0.6); line-height: 1.4; }
.hp-alerta button {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700; color: #ff92a7;
}
.hp-alerta button:hover { color: #fff; }

/* ----------------------------------------------- a bancada */

.hp-bancada { padding: 26px 34px 60px; min-width: 0; }
.hp-cab { display: flex; align-items: flex-start; gap: 20px; }
.hp-cab .hp-chapa { color: var(--roxo); }
.hp-cab h1 { font-family: var(--fonte-titulo); font-size: 33px; font-weight: 700; letter-spacing: -0.035em; margin: 9px 0 0; color: var(--tinta); }
.hp-cab p { margin: 7px 0 0; font-size: 14.5px; color: var(--tinta-2); }
.hp-cab .hp-fim { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.hp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: transform 130ms ease, filter 130ms ease;
}
.hp-btn:hover { transform: translateY(-1px); }
.hp-btn-marca { background: var(--roxo); color: #fff; box-shadow: 0 12px 26px -12px rgba(95, 49, 214, 0.9); }
.hp-btn-marca:hover { filter: brightness(1.08); }
.hp-btn-papel { background: var(--papel); color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--filete); }
.hp-btn-papel:hover { box-shadow: inset 0 0 0 1.5px var(--roxo-claro); }
.hp-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.hp-campo {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 14px; border-radius: 12px;
  background: var(--papel); box-shadow: inset 0 0 0 1px var(--filete);
}
.hp-campo input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: inherit; font-size: 14px; color: var(--tinta);
}

/* Placar: barra única dividida por filetes, sem cartão flutuante. */
.hp-placar {
  margin-top: 24px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--papel); border-radius: 16px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--filete);
}
.hp-placar > div { padding: 17px 20px; }
.hp-placar > div + div { box-shadow: inset 1px 0 0 var(--filete); }
.hp-placar .hp-chapa { font-size: 9px; color: var(--tinta-3); }
.hp-placar b { display: block; margin-top: 7px; font-family: var(--fonte-titulo); font-size: 29px; font-weight: 700; letter-spacing: -0.04em; color: var(--tinta); }
.hp-placar span { font-size: 12.5px; color: var(--tinta-3); }
.hp-placar .hp-quente { background: linear-gradient(135deg, rgba(240, 82, 110, 0.09), rgba(247, 156, 45, 0.07)); }
.hp-placar .hp-quente b { color: var(--rosa); }

/* Abas em sublinhado */
.hp-abas { margin-top: 28px; display: flex; gap: 22px; border-bottom: 1px solid var(--filete); flex-wrap: wrap; }
.hp-aba {
  border: 0; background: none; cursor: pointer; padding: 0 0 12px;
  font-family: inherit; font-size: 14.5px; font-weight: 700; color: var(--tinta-3);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.hp-aba[data-ativo="1"] { color: var(--tinta); border-bottom-color: var(--roxo); }
.hp-aba .hp-n {
  font-family: var(--fonte-mono); font-size: 11px; font-weight: 600;
  margin-left: 6px; padding: 2px 6px; border-radius: 5px;
  background: var(--papel-3); color: var(--tinta-3);
}

/* Lista corrida */
.hp-lista { margin-top: 4px; }
.hp-lista-cab, .hp-linha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px 120px 104px 128px 82px;
  align-items: center; gap: 14px; padding: 0 10px;
}
.hp-lista-cab {
  height: 40px; font-family: var(--fonte-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--tinta-3);
}
.hp-linha {
  min-height: 66px; border-bottom: 1px solid rgba(228, 224, 242, 0.6);
  text-decoration: none; color: inherit;
}
.hp-linha:hover { background: var(--papel); }
.hp-linha h3 { font-size: 15px; font-weight: 700; margin: 0; color: var(--tinta); }
.hp-linha .hp-end { display: block; margin-top: 3px; font-family: var(--fonte-mono); font-size: 11px; color: var(--tinta-3); }

.hp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 700; background: var(--papel-3); color: var(--tinta-2);
}
.hp-chip i { width: 7px; height: 7px; border-radius: 2px; flex: none; }

.hp-estado { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.hp-estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.hp-no-ar { color: var(--esmeralda); }
.hp-no-ar::before { background: var(--esmeralda); box-shadow: 0 0 0 3px rgba(20, 199, 141, 0.18); }
.hp-rascunho { color: var(--ambar); }
.hp-rascunho::before { background: var(--ambar); box-shadow: 0 0 0 3px rgba(247, 156, 45, 0.18); }
.hp-revisar { color: var(--rosa); }
.hp-revisar::before { background: var(--rosa); box-shadow: 0 0 0 3px rgba(240, 82, 110, 0.18); }

.hp-leituras { font-family: var(--fonte-mono); font-size: 13px; font-weight: 600; color: var(--tinta); }

.hp-util { display: flex; align-items: center; gap: 9px; }
.hp-util .hp-trilho { flex: 1; height: 6px; border-radius: 99px; background: var(--papel-3); overflow: hidden; }
.hp-util .hp-trilho i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--roxo), var(--ciano)); }
.hp-util span { font-family: var(--fonte-mono); font-size: 11.5px; font-weight: 700; color: var(--tinta-2); }
.hp-util[data-ruim="1"] .hp-trilho i { background: linear-gradient(90deg, var(--rosa), var(--ambar)); }

.hp-vazio {
  margin-top: 20px; padding: 44px 20px; border-radius: 16px; text-align: center;
  background: var(--papel); box-shadow: inset 0 0 0 1px var(--filete);
}
.hp-vazio b { display: block; font-family: var(--fonte-titulo); font-size: 19px; font-weight: 700; letter-spacing: -0.025em; color: var(--tinta); }
.hp-vazio p { margin: 7px 0 0; font-size: 13.5px; color: var(--tinta-3); }

/* Buscas sem resposta */
.hp-termo {
  display: grid; grid-template-columns: minmax(0, 1fr) 90px 150px;
  align-items: center; gap: 14px; padding: 13px 10px;
  border-bottom: 1px solid rgba(228, 224, 242, 0.7);
}
.hp-termo b { font-family: var(--fonte-mono); font-size: 13.5px; font-weight: 600; color: var(--tinta); }
.hp-termo .hp-qtd { font-family: var(--fonte-mono); font-size: 12px; color: var(--tinta-3); }
.hp-termo button {
  justify-self: end; border: 0; cursor: pointer; background: transparent;
  font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--roxo);
  padding: 7px 12px; border-radius: 9px; box-shadow: inset 0 0 0 1.5px rgba(95, 49, 214, 0.28);
}
.hp-termo button:hover { background: var(--roxo); color: #fff; box-shadow: none; }

/* Seções e trilhas */
.hp-cartoes { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 0; border-top: 1px solid var(--filete); border-left: 1px solid var(--filete); }
.hp-cartao {
  position: relative; padding: 20px; text-align: left;
  border-right: 1px solid var(--filete); border-bottom: 1px solid var(--filete);
  background: transparent; cursor: pointer; font-family: inherit;
}
.hp-cartao:hover { background: var(--papel); }
.hp-cartao .hp-marca { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.hp-cartao h3 { font-family: var(--fonte-titulo); font-size: 18px; font-weight: 700; letter-spacing: -0.025em; margin: 14px 0 0; color: var(--tinta); }
.hp-cartao p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--tinta-2); min-height: 39px; }
.hp-cartao .hp-pe { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; }
.hp-cartao .hp-chapa { font-size: 9px; color: var(--tinta-3); }

/* Painel lateral de edição */
.hp-fundo {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(11, 6, 32, 0.55); backdrop-filter: blur(3px);
  display: flex; justify-content: flex-end;
}
.hp-gaveta {
  width: min(460px, 100%); height: 100%; overflow-y: auto;
  background: var(--papel); padding: 24px 26px 40px;
  box-shadow: -30px 0 70px -30px rgba(11, 6, 32, 0.5);
}
.hp-gaveta h2 { font-family: var(--fonte-titulo); font-size: 24px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 0; color: var(--tinta); }
.hp-rot { display: block; font-size: 12.5px; font-weight: 700; color: var(--tinta-2); margin: 16px 0 6px; }
.hp-cx {
  width: 100%; height: 44px; padding: 0 12px;
  border: 0; border-radius: 11px; background: var(--papel-2);
  box-shadow: inset 0 0 0 1px var(--filete);
  font-family: inherit; font-size: 14px; color: var(--tinta); outline: none;
}
.hp-cx:focus { box-shadow: inset 0 0 0 1.5px var(--roxo-claro); }
textarea.hp-cx { height: auto; padding: 11px 12px; line-height: 1.5; resize: vertical; }
.hp-cx.hp-mono { font-size: 12.5px; }

.hp-escolhas { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.hp-escolha {
  width: 42px; height: 42px; border: 0; border-radius: 11px; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: var(--papel-2); box-shadow: inset 0 0 0 1px var(--filete);
}
.hp-escolha[data-ativo="1"] { box-shadow: 0 0 0 2px var(--tinta); }
.hp-cor { width: 30px; height: 30px; border-radius: 9px; border: 0; cursor: pointer; }
.hp-cor[data-ativo="1"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--tinta); }

.hp-aviso-erro {
  margin-top: 14px; padding: 11px 13px; border-radius: 11px;
  background: rgba(240, 82, 110, 0.1); box-shadow: inset 0 0 0 1px rgba(240, 82, 110, 0.3);
  font-size: 13px; color: #8a1b33;
}
