/* ======================================================================
   Wimo · varningstecken för hinder och hindernotisen
   ====================================================================== */

.p4-hindermark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 13px;
  line-height: 1;
  color: var(--varning);
  filter: saturate(1.2);
}
.p4-hindermark.sen {
  color: var(--leverans);
}
.p4-hindermark.dold {
  display: none;
}
.projektknapp .p4-hindermark {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--varning-fyll);
  font-size: 12px;
}
.projektknapp .p4-hindermark.sen {
  background: var(--leverans-fyll);
}

/* ---------- notisen ---------- */
.p4-hnotis {
  position: fixed;
  top: calc(var(--hh, 64px) + 14px);
  right: 18px;
  z-index: 90;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-left: 2px solid var(--varning-stark, #d9a21b);
  border-radius: var(--r-m);
  box-shadow: 0 18px 44px rgba(17, 19, 21, .16), 0 3px 10px rgba(17, 19, 21, .06);
  padding: 14px 14px 12px 16px;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.p4-hnotis.sen {
  border-left-color: var(--leverans);
}
.p4-hnotis.synlig {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.p4-hnotis:empty {
  display: none;
}
.p4-hnotis-topp {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.p4-hnotis-ikon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--varning);
  background: var(--varning-fyll);
}
.p4-hnotis.sen .p4-hnotis-ikon {
  color: var(--leverans);
  background: var(--leverans-fyll);
}
.p4-hnotis-rubrik {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.p4-hnotis-rubrik b {
  font-family: var(--rubrik);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.p4-hnotis-rubrik small {
  font-size: 12px;
  color: var(--text-muted);
}
.p4-hnotis-rubrik em {
  font-style: normal;
  font-weight: 700;
  color: var(--leverans);
}
.p4-hnotis-x {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.p4-hnotis-x:hover {
  background: var(--bg-main);
  color: var(--text-main);
}
.p4-hnotis-lista {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.p4-hnotis-lista li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 0 7px 10px;
  border-top: 1px solid var(--border-light);
  border-left: 2px solid transparent;
}
.p4-hnotis-lista li.sen {
  border-left-color: var(--leverans);
}
.p4-hnotis-vad {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p4-hnotis-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}
.p4-hnotis-lista li.sen .p4-hnotis-meta {
  color: var(--leverans);
}
.p4-hnotis-fler {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 0 0 10px;
}
.p4-hnotis-fot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* hinderpanelen blinkar till när man kommer dit från notisen */
@keyframes p4blink {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px var(--varning-stark, #d9a21b); }
}
.p4-hinderpanel.p4-blink {
  animation: p4blink 1.4s ease 2;
}

@media (max-width: 560px) {
  .p4-hnotis {
    right: 16px;
    left: 16px;
    width: auto;
  }
}
@media print {
  .p4-hnotis { display: none !important; }
}

/* ---------- notiserna staplas uppe till höger ---------- */
.p4-notiser {
  position: fixed;
  top: calc(var(--hh, 64px) + 14px);
  right: 18px;
  z-index: 90;
  width: 360px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.p4-notiser .p4-hnotis {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  width: auto;
  max-width: none;
}
.p4-notiser .p4-hnotis:not(.synlig) {
  display: none;
}
.p4-vnotis {
  border-left-color: var(--leverans);
}
.p4-vnotis .p4-hnotis-ikon {
  color: var(--leverans);
  background: var(--leverans-fyll);
  font-size: 17px;
}
@media (max-width: 560px) {
  .p4-notiser {
    right: 16px;
    left: 16px;
    width: auto;
  }
}
@media print {
  .p4-notiser { display: none !important; }
}
@keyframes p4notisIn { from { opacity: 0; transform: translateY(-8px); } }
.p4-notiser .p4-hnotis.synlig { animation: p4notisIn .22s ease; }
