.card-actions .status-button { margin-left: auto; }
.notes-button { position: relative; z-index: 2; display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 0; background: #f0ede5; padding: 0; border-radius: 50%; cursor: pointer; color: #625f58; font-size: 20px; line-height: 1; }
.notes-button:hover { background: #ffe5db; color: #b83216; }
.notes-count { position: absolute; top: -3px; right: -3px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; box-shadow: 0 0 0 2px var(--panel); font-size: 10px; line-height: 1; font-weight: 750; pointer-events: none; }
.notes-dialog {
  --notes-surface: #f3f3f3;
  --notes-border: #a1a1a1;
  width: min(526px, calc(100% - 28px));
  height: min(600px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  padding: 20px 25px;
  border: 0;
  border-radius: 20px;
  corner-shape: round;
  overflow: hidden;
  background: var(--notes-surface);
  color: #000;
  box-shadow: none;
}
.notes-dialog[open] { display: flex; flex-direction: column; gap: 20px; }
.notes-dialog .notes-head { padding: 0; border: 0; gap: 24px; flex-shrink: 0; }
.notes-head > div { flex: 1; min-width: 0; }
.notes-dialog .notes-head h2 { margin: 0; font-family: inherit; font-size: 24px; line-height: 29px; font-weight: 600; letter-spacing: normal; }
.notes-dialog .notes-head p { margin: 0; font-size: 12px; line-height: 15px; color: #000; overflow-wrap: anywhere; }
.notes-close { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; border-radius: 50%; cursor: pointer; }
.notes-close img { display: block; }
.notes-close:hover { background: #e8e8e8; }
.notes-history { flex: 1; min-height: 0; position: relative; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: -8px; padding: 8px; }
.notes-empty { height: 100%; display: grid; place-items: center; }
.notes-empty span { position: relative; width: 120px; height: 120px; mask: url('icons/notes-empty-mask.svg') center / 120px 120px no-repeat; }
.notes-empty img { position: absolute; left: 15px; top: 15px; }
.notes-entries { min-height: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 12px; }
.notes-entries:empty { display: none; }
.notes-entry { position: relative; flex-shrink: 0; margin: 0; max-width: calc(100% - 6px); border-radius: 16px; }
.notes-entry-text { padding: 10px 28px 10px 12px; background: #fff; width: fit-content; max-width: min(358px, calc(100% - 6px)); }
.notes-entry-text p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 15px; font-weight: 500; }
.notes-entry-image a { display: block; border-radius: inherit; }
.notes-entry-image a > img { display: block; max-width: 100%; width: auto; height: auto; max-height: 150px; border-radius: inherit; }
.notes-remove { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.notes-remove > img { position: absolute; left: -2px; top: -2px; }
.notes-remove:hover { background: #ffe5db; }
.notes-editor { display: flex; flex-direction: column; gap: 20px; flex-shrink: 0; }
.notes-composer { position: relative; height: 131px; border: 1px solid var(--notes-border); border-radius: 16px; }
.notes-composer:focus-within { border-color: #686868; }
.notes-composer textarea { display: block; width: 100%; height: 100%; padding: 12px 14px 36px; border: 0; background: transparent; border-radius: inherit; resize: none; color: #000; font-size: 13px; line-height: 18px; }
.notes-composer textarea:focus-visible { outline-offset: 3px; }
.notes-attach { position: absolute; right: 8px; bottom: 8px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.notes-attach span { display: block; position: relative; width: 24px; height: 24px; mask: url('icons/notes-attach-mask.svg') center / 24px 24px no-repeat; }
.notes-attach img { position: absolute; left: 5.5px; top: 2px; }
.notes-attach:hover { background: #e5e5e5; }
.notes-pending { position: absolute; bottom: 10px; left: 12px; right: 45px; display: flex; gap: 12px; padding-top: 6px; }
.notes-pending-image { position: relative; margin: 0; min-width: 0; }
.notes-pending-image > img { display: block; width: 48px; height: 40px; object-fit: cover; border-radius: 8px; }
.has-attachments textarea { padding-bottom: 65px; }
.notes-footer { display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-height: 40px; }
.notes-message { flex: 1; margin: 0; color: var(--muted); font-size: 12px; line-height: 15px; }
.notes-message.error { color: #bd3926; }
.notes-add { height: 40px; flex-shrink: 0; padding: 0 16px; border: 0; border-radius: 40px; background: #000; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.notes-add:hover { background: #303030; }
.notes-add:disabled { background: #000; cursor: default; }
.notes-dialog button:disabled { cursor: default; }
.notes-dialog [aria-busy=true] .notes-remove, .notes-attach:disabled { opacity: .45; }
@media (max-width: 540px) {
  .notes-dialog { padding: 20px; }
  .notes-dialog .notes-head { gap: 12px; }
  .notes-dialog .notes-head h2 { font-size: 21px; line-height: 26px; }
}
@media (max-height: 480px) {
  .notes-dialog[open], .notes-editor { gap: 12px; }
  .notes-dialog { padding-block: 16px; }
  .notes-composer { height: 96px; }
}
