/* ============================================================
   OVERLAYS — Search Palette, Notes Panel, Profile Menu
   ============================================================ */

.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  animation: fadeIn 0.16s ease-out;
}
.notes-overlay { justify-content: flex-end; padding: 0; align-items: stretch; }
.profile-overlay { justify-content: flex-start; padding: 0; align-items: flex-end; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideRight { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideProfile { from { transform: translateX(-12px) translateY(8px); opacity: 0; } to { transform: translateX(0) translateY(0); opacity: 1; } }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-2);
  letter-spacing: 0;
  text-transform: none;
}

/* =============== SEARCH PALETTE =============== */
.palette {
  width: min(640px, 92vw);
  max-height: 72vh;
  background: linear-gradient(180deg, #14110b 0%, #0f0d08 100%);
  border: 1px solid rgba(196,164,108,0.2);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.03) inset;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.18s ease-out;
}

.palette-search {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--stroke);
}
.palette-search i { color: var(--ink-4); font-size: 15px; }
.palette-search input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: var(--ink);
  font-size: 15px;
  font-family: var(--font-serif);
  font-weight: 400;
}
.palette-search input::placeholder { color: var(--ink-4); }

.palette-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.palette-body::-webkit-scrollbar { width: 6px; }
.palette-body::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 3px; }

.palette-group { padding: 4px 0; }
.palette-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-5);
  padding: 8px 18px 6px;
}

.palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 18px;
  cursor: pointer;
  position: relative;
  transition: background 0.12s;
}
.palette-item.active {
  background: rgba(196,164,108,0.08);
  box-shadow: inset 3px 0 0 var(--gold);
}

.palette-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.palette-text { flex: 1; min-width: 0; }
.palette-title {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.palette-sub {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.palette-kind {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-5);
  padding: 3px 7px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
}
.palette-enter {
  color: var(--gold);
  font-size: 11px;
  margin-left: 4px;
}

.palette-empty {
  padding: 48px 18px;
  text-align: center;
  color: var(--ink-4);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.palette-empty i { font-size: 32px; color: var(--ink-5); }
.palette-empty b { color: var(--ink-2); }

.palette-foot {
  display: flex; gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--stroke);
  background: rgba(0,0,0,0.35);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.06em;
}
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* =============== NOTES PANEL (right drawer) =============== */
.notes-panel {
  width: min(440px, 90vw);
  background: linear-gradient(180deg, #14110b 0%, #0f0d08 100%);
  border-left: 1px solid var(--stroke);
  display: flex; flex-direction: column;
  animation: slideRight 0.2s ease-out;
  box-shadow: -24px 0 60px rgba(0,0,0,0.5);
}
.notes-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stroke);
}
.notes-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}
.notes-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  margin-top: 2px;
}
.notes-text {
  flex: 1;
  resize: none;
  background: transparent;
  border: none; outline: none;
  padding: 20px 22px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.003em;
}
.notes-text::placeholder {
  color: var(--ink-5);
  font-style: italic;
}
.notes-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--stroke);
  background: rgba(0,0,0,0.3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-4);
}

/* =============== PROFILE MENU (bottom-left) =============== */
.profile-card {
  width: 320px;
  margin: 0 0 12px 80px;
  background: linear-gradient(180deg, #14110b 0%, #0f0d08 100%);
  border: 1px solid rgba(196,164,108,0.22);
  border-radius: 12px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7);
  overflow: hidden;
  animation: slideProfile 0.18s ease-out;
}
.profile-head {
  display: flex; gap: 12px; align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--stroke);
}
.profile-head img {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid rgba(196,164,108,0.3);
}
.profile-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.profile-role {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  gap: 10px;
}
.profile-stats > div {
  display: flex; flex-direction: column; gap: 3px;
  align-items: center;
  text-align: center;
}
.profile-stats .l {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-5);
}
.profile-stats .v {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.profile-stats .v.gold { color: var(--gold); }

.profile-menu { padding: 6px 0; }
.profile-menu button {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  background: transparent;
  border: none;
  padding: 10px 18px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.profile-menu button > i:first-child {
  width: 16px;
  color: var(--ink-4);
  font-size: 12px;
}
.profile-menu button > i:last-child {
  margin-left: auto;
  color: var(--ink-5);
  font-size: 10px;
}
.profile-menu button:hover {
  background: rgba(255,255,255,0.03);
  color: var(--ink);
}
.profile-menu button:hover > i { color: var(--gold); }

.profile-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--stroke);
  background: rgba(0,0,0,0.3);
}
.profile-foot .logout {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink-3);
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.12s, border-color 0.12s;
}
.profile-foot .logout:hover { color: #E55; border-color: rgba(229,85,85,0.3); }

/* Search chip in page header */
.chip-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  font-family: inherit;
  color: inherit;
}
.chip-btn:hover {
  background: rgba(196,164,108,0.06);
  border-color: rgba(196,164,108,0.25);
}
.chip-btn .kbd { margin-left: 2px; }
