/* Project notes — collapsible panel pinned to the bottom-right of the project
   page, outside the tab frame. z-index clears the mobile .budget-line-toolbar
   (50, invoices.css) and stays under the sticky nav (100, base.css). */

.project-notes {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.project-notes-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--teal-dark);
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.project-notes-launcher:hover {
  background: var(--teal-dark);
}

.project-notes-launcher .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.project-notes-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--teal-dark);
}

.project-notes-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: min(380px, calc(100vw - 48px));
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.project-notes.is-open .project-notes-panel {
  display: flex;
}

.project-notes.is-open .project-notes-launcher {
  order: 1;
}

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

.project-notes-header h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-strong);
}

.project-notes-close {
  border: none;
  background: none;
  padding: 0 4px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--gray-mid);
  cursor: pointer;
}

.project-notes-close:hover {
  color: var(--text-strong);
}

.project-notes-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  color: var(--gray-dark);
}

.project-notes-stamp {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--gray-mid);
}

.project-notes-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.project-notes-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 640px) {
  .project-notes {
    right: 12px;
    bottom: 12px;
  }

  .project-notes-panel {
    width: calc(100vw - 24px);
  }
}
