#party-root {
  position: fixed;
  right: 14px;
  top: 14px;
  z-index: 2147483647;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #e8ecf3;
}
#party-root * { box-sizing: border-box; }
#party-toggle {
  background: linear-gradient(135deg, #6c8cff, #9b6cff);
  color: #fff; border: 0; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
#party-panel {
  position: fixed; top: 60px; right: 14px; left: auto; bottom: auto; margin: 0; padding: 0;
  width: 286px; max-height: 64vh; flex-direction: column;
  background: rgba(16,19,26,.97); border: 1px solid #2a3040; border-radius: 12px;
  overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.6);
  color: #e8ecf3;
}
#party-panel:popover-open { display: flex; }
.party-hidden { display: none !important; }
.party-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; font-weight: 700; background: #161a22; border-bottom: 1px solid #2a3040;
}
#party-status { font-size: 11px; font-weight: 500; color: #8b95a7; margin-left: auto; }
#party-status.party-on { color: #6ee7a8; }
#party-status.party-off { color: #8b95a7; }
#party-close { background: transparent; color: #8b95a7; border: 0; font-size: 18px; cursor: pointer; padding: 0 2px; }

#party-start, #party-room { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
#party-root input {
  background: #1d222c; color: #e8ecf3; border: 1px solid #2a3040;
  border-radius: 8px; padding: 7px 9px; font-size: 13px; outline: none; width: 100%;
}
#party-root input:focus { border-color: #6c8cff; }
#party-root button { cursor: pointer; }
#party-create, #party-join, #party-send {
  background: #6c8cff; color: #fff; border: 0; border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
#party-create { font-weight: 600; padding: 9px; }
#party-ping { background: #9b6cff; color: #fff; border: 0; border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.party-small { background: transparent; color: #8b95a7; border: 1px solid #2a3040; border-radius: 8px; padding: 5px 8px; font-size: 12px; }
.party-or { color: #8b95a7; font-size: 12px; text-align: center; }
.party-roomhead { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.party-roomhead span { flex: 1; }
.party-row { display: flex; gap: 6px; align-items: center; }
.party-row input { flex: 1; }
.party-error { color: #ff6b6b; font-size: 12px; min-height: 14px; }
.party-muted { color: #8b95a7; font-size: 12px; }
#party-code-label { color: #c9a6ff; letter-spacing: 2px; }
#party-log { flex: 1; min-height: 60px; max-height: 30vh; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.party-msg { font-size: 13px; word-wrap: break-word; }
.party-msg.party-system { color: #8b95a7; font-style: italic; }
.party-msg.party-ping-msg { color: #c9a6ff; font-weight: 600; }
#party-toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%);
  background: #9b6cff; color: #fff; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
body.party-flash { animation: partyFlash .5s ease; }
@keyframes partyFlash { 0%,100% { filter: none; } 50% { filter: brightness(1.35); } }
