:root {
  --wgn-navy: #0c2638;
  --wgn-navy-soft: #173f55;
  --wgn-gold: #c9a45e;
  --wgn-line: #dfe7ea;
  --wgn-surface: #ffffff;
  --wgn-bg: #f4f7f8;
  --wgn-text: #172832;
  --wgn-muted: #6c7c85;
  --wgn-danger: #ae3434;
  --wgn-success: #15714f;
}

#wifaqGlobalNotesButton {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 2490;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  background:
    linear-gradient(
      145deg,
      var(--wgn-navy-soft),
      var(--wgn-navy)
    );
  box-shadow:
    0 16px 38px
    rgba(7, 32, 46, .28);
  transition:
    transform .18s ease,
    box-shadow .18s ease;
}

#wifaqGlobalNotesButton:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 42px
    rgba(7, 32, 46, .34);
}

#wifaqGlobalNotesButton svg {
  width: 25px;
  height: 25px;
}

#wifaqGlobalNotesBadge {
  position: absolute;
  right: -6px;
  top: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  background: #c73d3d;
}

#wifaqGlobalNotesBadge.show {
  display: inline-flex;
}

#wifaqGlobalNotesOverlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  background: rgba(5, 25, 37, .5);
  backdrop-filter: blur(2px);
}

#wifaqGlobalNotesOverlay.open {
  display: block;
}

#wifaqGlobalNotesDrawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 2510;
  width: min(520px, 100vw);
  display: flex;
  flex-direction: column;
  direction: rtl;
  color: var(--wgn-text);
  background: var(--wgn-bg);
  box-shadow:
    28px 0 70px
    rgba(5, 25, 37, .24);
  transform: translateX(-105%);
  transition: transform .24s ease;
  font-family:
    Tahoma,
    Arial,
    sans-serif;
}

#wifaqGlobalNotesDrawer.open {
  transform: translateX(0);
}

.wgn-header {
  flex: 0 0 auto;
  padding: 18px 19px 14px;
  color: #fff;
  background:
    linear-gradient(
      145deg,
      var(--wgn-navy-soft),
      var(--wgn-navy)
    );
}

.wgn-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wgn-title {
  margin: 0;
  font-size: 18px;
}

.wgn-close {
  width: 37px;
  height: 37px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  background:
    rgba(255, 255, 255, .1);
}

.wgn-context-title {
  margin-top: 8px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  line-height: 1.7;
}

.wgn-tools {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) 125px;
  gap: 8px;
  padding: 12px;
  border-bottom:
    1px solid var(--wgn-line);
  background: #fff;
}

.wgn-tools input,
.wgn-tools select,
.wgn-compose textarea {
  width: 100%;
  border:
    1px solid var(--wgn-line);
  border-radius: 11px;
  outline: none;
  color: var(--wgn-text);
  background: #fff;
}

.wgn-tools input,
.wgn-tools select {
  min-height: 39px;
  padding: 8px 11px;
  font-size: 12px;
}

.wgn-notes-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 13px;
}

.wgn-empty,
.wgn-loading {
  padding: 35px 15px;
  border:
    1px dashed #cbd7dc;
  border-radius: 15px;
  color: var(--wgn-muted);
  text-align: center;
  font-size: 12px;
  background: #fff;
}

.wgn-note {
  margin-bottom: 11px;
  padding: 14px;
  border:
    1px solid var(--wgn-line);
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 8px 24px
    rgba(15, 43, 57, .045);
}

.wgn-note.pinned {
  border-color: #dfc68f;
  background:
    linear-gradient(
      180deg,
      #fffdf7,
      #fff
    );
}

.wgn-note-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.wgn-note-user {
  min-width: 0;
}

.wgn-note-user strong {
  display: block;
  color: var(--wgn-navy);
  font-size: 12px;
}

.wgn-note-date {
  display: block;
  margin-top: 4px;
  color: var(--wgn-muted);
  font-size: 10px;
}

.wgn-pin-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #7d5b17;
  font-size: 10px;
  font-weight: 800;
  background: #fff0c8;
}

.wgn-note-text {
  margin: 12px 0 0;
  color: #273943;
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wgn-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wgn-action {
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: #38505d;
  font-size: 10px;
  font-weight: 700;
  background: #edf2f4;
}

.wgn-action.danger {
  color: var(--wgn-danger);
  background: #fff0f0;
}

.wgn-attachments {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.wgn-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #edf2f4;
}

.wgn-image-wrap img {
  width: 100%;
  max-height: 270px;
  display: block;
  object-fit: contain;
  cursor: zoom-in;
}

.wgn-audio {
  width: 100%;
}

.wgn-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border:
    1px solid var(--wgn-line);
  border-radius: 11px;
  background: #f8fafb;
}

.wgn-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.wgn-file-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.wgn-compose {
  flex: 0 0 auto;
  padding: 12px;
  border-top:
    1px solid var(--wgn-line);
  background: #fff;
}

.wgn-message {
  display: none;
  margin-bottom: 9px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.6;
}

.wgn-message.show {
  display: block;
}

.wgn-message.error {
  color: #9f2f2f;
  background: #fff0f0;
}

.wgn-message.success {
  color: var(--wgn-success);
  background: #eaf8f2;
}

.wgn-compose textarea {
  min-height: 78px;
  max-height: 150px;
  resize: vertical;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.7;
}

.wgn-compose-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.wgn-compose-button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: #25404d;
  font-size: 11px;
  font-weight: 800;
  background: #eaf0f2;
}

.wgn-compose-button.primary {
  margin-right: auto;
  color: #fff;
  background: var(--wgn-navy);
}

.wgn-compose-button.recording {
  color: #fff;
  background: #bd3535;
}

.wgn-pin-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4b606b;
  font-size: 11px;
  font-weight: 700;
}

.wgn-pin-check input {
  width: 17px;
  height: 17px;
}

.wgn-pending {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.wgn-pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #425965;
  font-size: 10px;
  background: #f1f5f6;
}

.wgn-pending-remove {
  border: 0;
  cursor: pointer;
  color: var(--wgn-danger);
  background: transparent;
}

.wgn-record-preview {
  display: none;
  margin-top: 8px;
}

.wgn-record-preview.show {
  display: block;
}

.wgn-record-time {
  color: #ba3737;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 650px) {
  #wifaqGlobalNotesButton {
    left: 14px;
    bottom: 14px;
    width: 52px;
    height: 52px;
  }

  #wifaqGlobalNotesDrawer {
    width: 100vw;
  }

  .wgn-tools {
    grid-template-columns: 1fr;
  }
}
