/* Floating WhatsApp + Notes plate — mirrors cosmic home NotePlate UX */
.lp-note-chrome {
  --lp-note-border: rgba(147, 148, 155, 0.14);
  --lp-note-border-active: rgba(232, 205, 184, 0.35);
  --lp-note-text: #e8ebee;
  --lp-note-muted: #94a3b8;
  --lp-note-accent: #e8cdb8;
  --lp-note-bg: rgba(40, 52, 64, 0.72);
  --lp-note-bg-solid: rgba(40, 52, 64, 0.92);
  --lp-note-chip-bg: #11171e;
  --lp-note-radius: 16px;
}

.lp-note-chrome .note-plate-wa {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  z-index: 1;
  display: block;
  width: 36px;
  height: 36px;
  background: transparent;
  text-decoration: none;
  line-height: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  animation: lp-note-plate-wa-bounce 2.4s ease-in-out infinite;
  transition: filter 0.2s ease;
}

.lp-note-chrome .note-plate-wa-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.lp-note-chrome .note-plate-wa:hover,
.lp-note-chrome .note-plate-wa:focus-visible {
  animation-play-state: paused;
  transform: translateY(-5px) scale(1.12);
  filter:
    drop-shadow(0 0 4px rgba(37, 211, 102, 0.85))
    drop-shadow(0 0 10px rgba(37, 211, 102, 0.55))
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.2));
  outline: none;
}

@keyframes lp-note-plate-wa-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.lp-note-chrome .note-plate--mobile .note-plate-wa {
  right: 1rem;
}

.lp-note-chrome .note-plate--desktop {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 45;
  width: 280px;
  padding: 1rem;
  border: 1px solid var(--lp-note-border);
  border-radius: var(--lp-note-radius);
  background: var(--lp-note-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  color: var(--lp-note-text);
}

@media (min-width: 768px) {
  .lp-note-chrome .note-plate--desktop {
    display: block;
  }

  .lp-note-chrome .note-plate--mobile {
    display: none;
  }
}

.lp-note-chrome .note-plate--hover {
  border-color: var(--lp-note-border-active);
  box-shadow:
    0 0 0 1px rgba(232, 205, 184, 0.2),
    0 8px 28px rgba(0, 0, 0, 0.4);
}

.lp-note-chrome .note-plate-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.lp-note-chrome .note-plate-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--lp-note-text);
}

.lp-note-chrome .note-plate-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #11171e;
  background: var(--lp-note-accent);
  border-radius: 999px;
}

.lp-note-chrome .note-plate-clear {
  margin-left: auto;
  border: none;
  background: transparent;
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  color: var(--lp-note-muted);
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.lp-note-chrome .note-plate-clear:hover {
  color: var(--lp-note-accent);
  background: rgba(201, 169, 98, 0.12);
}

.lp-note-chrome .note-plate-clear--confirm {
  color: var(--lp-note-accent);
  background: rgba(201, 169, 98, 0.16);
}

.lp-note-chrome .note-plate-empty {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--lp-note-muted);
  margin: 0;
}

.lp-note-chrome .note-plate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lp-note-chrome .note-plate-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--lp-note-muted);
  border: 1px dashed var(--lp-note-border);
  border-radius: 10px;
}

.lp-note-chrome .note-plate-cta {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  color: var(--lp-note-accent);
  border-top: 1px solid var(--lp-note-border);
  transition: color 0.15s;
}

.lp-note-chrome .note-plate--hover .note-plate-cta.is-visible {
  display: block;
}

.lp-note-chrome .note-plate-cta:hover {
  color: #f0e1d2;
}

.lp-note-chrome .note-plate--mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom, 0));
  background: var(--lp-note-bg-solid);
  border-top: 1px solid var(--lp-note-border);
  backdrop-filter: blur(18px);
  color: var(--lp-note-text);
}

.lp-note-chrome .note-mobile-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--lp-note-text);
  font-family: inherit;
}

.lp-note-chrome .note-mobile-bar-label {
  font-size: 0.8125rem;
  font-weight: 500;
  flex-shrink: 0;
}

.lp-note-chrome .note-mobile-bar-preview {
  display: flex;
  gap: 0.375rem;
  overflow: hidden;
  flex: 1;
}

.lp-note-chrome .note-mobile-bar-hint {
  font-size: 0.75rem;
  color: var(--lp-note-muted);
}

.lp-note-chrome .note-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--lp-note-border);
  border-radius: 10px;
  background: var(--lp-note-chip-bg);
  cursor: default;
  width: 56px;
  height: 56px;
}

.lp-note-chrome .note-chip-label {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  font-size: 0.5625rem;
  font-weight: 500;
  text-align: center;
  padding: 0.25rem;
  line-height: 1.15;
  color: var(--lp-note-muted);
  word-break: break-word;
}

.lp-note-chrome .note-chip-remove {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--lp-note-text);
  background: rgba(17, 23, 30, 0.82);
  opacity: 0;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.lp-note-chrome .note-chip:hover .note-chip-remove,
.lp-note-chrome .note-chip:focus-within .note-chip-remove {
  opacity: 1;
}

.lp-note-chrome .note-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.55);
}

.lp-note-chrome .note-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: #11171e;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--lp-note-text);
}

.lp-note-chrome .note-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0.75rem auto 0;
  background: rgba(147, 148, 155, 0.35);
  border-radius: 999px;
}

.lp-note-chrome .note-sheet-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}

.lp-note-chrome .note-sheet-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  margin-right: auto;
}

.lp-note-chrome .note-sheet-header .note-plate-clear {
  margin-left: 0;
}

.lp-note-chrome .note-sheet-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: var(--lp-note-text);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.lp-note-chrome .note-sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.25rem 1rem;
  overflow-y: auto;
}

.lp-note-chrome .note-sheet-footer {
  padding: 0.75rem 1.25rem 1.25rem;
  border-top: 1px solid var(--lp-note-border);
}

.lp-note-chrome .note-sheet-cta {
  display: block;
  width: 100%;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #11171e;
  background: var(--lp-note-accent);
  border-radius: 12px;
}

@media (max-width: 767px) {
  body.lp-has-note-chrome {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
  }
}

/* Top-right 「加入笔记」 — mirrors cosmic .note-add-btn */
.note-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.625rem;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  color: #e8ebee;
  background: rgba(40, 52, 64, 0.85);
  border: 1px solid rgba(147, 148, 155, 0.22);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.note-add-btn:hover {
  background: #e8cdb8;
  color: #11171e;
  border-color: #e8cdb8;
}

.note-add-btn--active {
  background: #e8cdb8;
  color: #11171e;
  border-color: #e8cdb8;
}

/* Toast — mirrors cosmic NoteToast */
.note-toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #11171e;
  background: #e8cdb8;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  animation: lp-note-toast-in 0.3s ease;
}

@media (min-width: 768px) {
  .note-toast {
    bottom: 2rem;
  }
}

.note-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.75rem;
  background: #0a1220;
  color: #e8cdb8;
  border-radius: 999px;
}

@keyframes lp-note-toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
