.residence-pc {
  position: fixed;
  inset: auto;
  box-sizing: border-box;
  margin: 0;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: #f9fdff;
  color: #10233a;
  z-index: 40;
}
.residence-pc[open] { display: flex; flex-direction: column; overflow: hidden; }
.residence-pc::backdrop { background: #03121b24; }
.residence-pc button {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #8da4b8;
  border-radius: 7px;
  color: #10233a;
  background: #ffffff;
  font: inherit;
  cursor: pointer;
}
.residence-pc button:disabled { opacity: .52; cursor: default; }
.residence-pc button:focus-visible, .residence-pc textarea:focus-visible { outline: 2px solid #78e6ea; outline-offset: 2px; }
.residence-pc button.rpc-primary, .residence-pc button[aria-pressed="true"] {
  background: #c9f1f4;
  border-color: #c9f1f4;
  color: #102c32;
  font-weight: 700;
}
.rpc-head, .rpc-nav, .rpc-chat-head, .rpc-files-head, .rpc-compose-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rpc-head, .rpc-chat-head, .rpc-files-head { justify-content: space-between; }
.rpc-head { flex: none; padding: 12px 22px 8px; }
.rpc-head h2, .rpc-files-head h3 { margin: 0; }
.rpc-head small { margin-inline-start: 8px; font-size: .62em; color: #5b7087; }
.rpc-kicker { color: #c9f1f4; font-size: .72rem; font-weight: 800; letter-spacing: .15em; }
.rpc-nav { flex: none; padding: 0 22px 12px; flex-wrap: wrap; border-bottom: 1px solid #c6dde8; }
.rpc-nav span { margin-inline-start: auto; color: #5b7087; font-size: .88rem; }
.rpc-notice { flex: none; padding: 6px 22px; color: #526e85; font-size: .88rem; }
.rpc-chat, .rpc-files { padding: 0 22px 18px; }
.rpc-chat:not([hidden]) { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: auto; }
.rpc-files { min-height: 0; overflow: auto; }
.rpc-chat-head { flex: none; color: #5b7087; font-size: .9rem; margin-bottom: 8px; }
.rpc-history, .rpc-file-list {
  background: #f0f8fc;
  border: 1px solid #c6dde8;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  min-height: 80px;
  max-height: 27dvh;
  overflow-wrap: anywhere;
}
.rpc-history { flex: 1; min-height: 48px; max-height: none; }
.rpc-history article + article { margin-top: 12px; border-top: 1px solid #c6dde8; padding-top: 10px; }
.rpc-history strong { color: #a8e8e5; }
.rpc-history p { white-space: pre-wrap; margin: 5px 0; }
.rpc-compose { flex: none; display: grid; gap: 7px; margin-top: 10px; }
.rpc-compose textarea {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  max-height: 22dvh;
  padding: 8px 10px;
  border: 1px solid #8da4b8;
  border-radius: 7px;
  background: #f0f8fc;
  color: inherit;
  font: inherit;
}
.rpc-compose-row { flex-wrap: wrap; }
.rpc-compose-row span { flex: 1; min-width: 6rem; font-size: .86rem; overflow-wrap: anywhere; }
.rpc-compose > p, .rpc-files > p, .rpc-files-head p { font-size: .82rem; color: #5b7087; }
.rpc-compose > p { margin: 0; }
.rpc-files > p { margin-top: 8px; }
.rpc-file-list { list-style: none; margin: 10px 0; }
.rpc-file-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.rpc-file-list li + li { margin-top: 8px; border-top: 1px solid #c6dde8; padding-top: 8px; }
.rpc-file-list li span { min-width: 0; overflow-wrap: anywhere; }
.rpc-file-list li div { display: flex; flex-wrap: wrap; gap: 5px; }
@media (max-width: 500px) {
  .rpc-head, .rpc-nav, .rpc-chat, .rpc-files, .rpc-notice { padding-inline: 12px; }
  .rpc-nav span { margin-inline-start: 0; }
  .rpc-kicker { display: none; }
  .rpc-head h2 { font-size: 1.15rem; }
  .rpc-chat, .rpc-files { padding-bottom: 9px; }
  .rpc-compose textarea { height: 55px; }
}

.residence-pc { border: 1px solid #86dce4; border-radius: 18px; font-family: inherit; }
.residence-pc button { min-height: 44px; border-radius: 10px; }
.rpc-head { padding-block: 18px; border-bottom: 1px solid #c6dde8; }
.rpc-nav { padding-top: 12px; }
.rpc-nav [aria-pressed=true] { border-bottom: 3px solid #00a9b5; }
.rpc-chat { overflow: hidden !important; }
.rpc-history { flex: 1; max-height: none; min-height: 60px; }
.rpc-history > div { margin-block: 10px; }
.rpc-compose { flex: none; padding-top: 12px; }
.rpc-compose textarea { background: white; color: #10233a; }
.rpc-files:not([hidden]) { display: flex; flex: 1; flex-direction: column; overflow: hidden; }
.rpc-file-list { flex: 1; max-height: none; }
.rpc-more { position: relative; display: flex; }
.rpc-more summary { cursor: pointer; min-width: 44px; min-height: 44px; text-align: center; list-style: none; border: 1px solid #8da4b8; border-radius: 10px; padding: 8px; box-sizing: border-box; }
.rpc-more[open] { padding: 8px; background: #e9f6fa; border-radius: 10px; }
.rpc-more[open] button { display: inline-block; margin: 4px; }
@media(max-width:500px),(max-height:500px) { .rpc-head { padding-block: 8px; } .rpc-kicker { display:none; } .rpc-nav { gap:5px; } .rpc-nav span { font-size: .7rem; } }
.rpc-history article { margin-block: 12px; padding: 12px 16px; border-radius: 12px; background: #eaf1f8; }
.rpc-history article:nth-child(odd) { margin-left: 15%; background: #d8f4f7; }
.rpc-history article:nth-child(even) { margin-right: 10%; }
.rpc-file-meta { margin-inline-start: auto; color: #5b7087; font-size: .85rem; }
