#app #home nav.home-side-nav.home-bottom-nav {
  grid-template-rows:repeat(5,minmax(0,1fr)) !important;
}

#homeFriendsButton { position:relative; }
#homeFriendsBadge, .friends-count {
  display:inline-grid;
  place-items:center;
  min-width:17px;
  min-height:17px;
  padding:1px 4px;
  border:1px solid #ffbedc;
  border-radius:999px;
  background:#842650;
  color:#fff;
  font:750 10px/1 system-ui,sans-serif;
}
#homeFriendsBadge { position:absolute; top:0; right:11%; }
#homeFriendsBadge[hidden], .friends-dialog [hidden] { display:none !important; }

.friends-dialog {
  box-sizing:border-box;
  width:min(94vw,760px);
  max-width:calc(100vw - max(10px,var(--safe-left)) - max(10px,var(--safe-right)));
  height:min(89dvh,560px);
  max-height:calc(100dvh - max(7px,var(--safe-top)) - max(7px,var(--safe-bottom)));
  margin:auto;
  padding:clamp(8px,1.5vw,17px);
  color:#f7ecdf;
  border:1px solid #cca879;
  border-radius:14px;
  background:linear-gradient(135deg,#302034 0%,#222132 44%,#102a28 100%);
  box-shadow:inset 0 0 30px #86604e22, 0 0 18px #de7ba852, 0 14px 60px #0009;
  font:500 clamp(11px,1.65vw,15px)/1.4 system-ui,sans-serif;
  overflow:hidden;
}
.friends-dialog[open] {
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:clamp(5px,1.5vh,12px);
}
.friends-dialog--send { width:min(88vw,490px); height:min(79dvh,410px); }
.friends-dialog::backdrop { background:#0d0711bb; }
.friends-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0 0 5px;
  border-bottom:1px solid #e1b98270;
}
.friends-header :is(h1,h2) {
  margin:0;
  color:#ffebc7;
  font:800 clamp(17px,3vw,28px)/1.15 system-ui,sans-serif;
}
.friends-dialog :is(button,input) {
  box-sizing:border-box;
  min-height:31px;
  padding:4px 10px;
  border:1px solid #926e83;
  border-radius:7px;
  font:inherit;
  font-weight:650;
  background:#142828;
  color:#fff1dc;
}
.friends-dialog button { cursor:pointer; white-space:nowrap; }
.friends-dialog button:disabled { opacity:.55; cursor:default; }
.friends-dialog :is(button,input):focus-visible { outline:2px solid #94f5dc; outline-offset:2px; }
.friends-dialog .friends-close { width:32px; min-height:32px; padding:0; border-color:#c79e71; font-size:22px; line-height:1; }
.friends-content {
  display:flex;
  flex-direction:column;
  min-height:0;
  gap:6px;
}
.friends-id, .friends-search form {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
}
.friends-id label { display:flex; align-items:center; gap:5px; }
.friends-id input, .friends-search input {
  width:clamp(116px,20vw,168px);
  min-width:0;
  font-family:ui-monospace,monospace;
  font-variant-numeric:tabular-nums;
  letter-spacing:.035em;
}
.friends-tabs {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
}
.friends-tabs button { padding-inline:2px; }
.friends-tabs button[aria-pressed="true"] {
  border-color:#d6a584;
  background:#583347;
  box-shadow:inset 0 0 10px #e291b64d;
}
.friends-count { margin-left:3px; }
.friends-list {
  display:flex;
  flex-direction:column;
  min-height:0;
  gap:5px;
  overflow:auto;
  overscroll-behavior:contain;
  padding:3px;
}
.friends-search { gap:8px; align-items:stretch; }
.friends-card {
  display:grid;
  grid-template-columns:clamp(34px,7vh,59px) minmax(0,1fr) auto;
  gap:clamp(4px,1.1vw,12px);
  align-items:center;
  padding:4px 6px;
  border:1px solid #a0748177;
  border-radius:8px;
  background:linear-gradient(110deg,#4b334a80,#171f2bbd 53%,#122d2e);
}
.friends-card__portrait {
  width:100%;
  aspect-ratio:1;
  object-fit:cover;
  border:1px solid #ac8c70;
  border-radius:8px;
  background:#221c32;
}
.friends-dialog button.friends-card__profile {
  min-height:0;
  padding:0;
  border:0;
  border-radius:8px;
  background:none;
}
.friends-card__profile img { display:block; }
.friends-card__identity { min-width:0; display:grid; }
.friends-card__identity strong { overflow-wrap:anywhere; color:#fff7e4; font-size:1.06em; }
.friends-card__identity small { color:#dcc6d9; }
.friends-card__identity .is-online { color:#9df5db; }
.friends-card__identity .is-online::before, .friends-table-header .is-online::before {
  content:'';
  display:inline-block;
  width:.53em;
  aspect-ratio:1;
  margin-inline-end:.48em;
  border-radius:50%;
  background:currentColor;
  box-shadow:0 0 7px currentColor;
  vertical-align:.08em;
}
.friends-card__buttons { display:flex; flex-wrap:wrap; justify-content:end; align-items:center; gap:4px; }
.friends-card__buttons button { padding-inline:6px; }
.friends-dialog button.friends-primary { background:#1d574c; border-color:#87d8ad; color:#f3ffef; }
.friends-empty { padding:8px; color:#e2d5dd; }
.friends-empty p { margin:0 0 6px; }
.friends-status { margin:0; min-height:1.2em; color:#f2d1ae; font-size:.92em; }
.friends-table-send { white-space:nowrap; }

.friends-dialog--table {
  width:min(93vw,465px);
  height:auto;
}
.friends-table-header {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding-bottom:6px;
  border-bottom:1px solid #cfa77e75;
}
.friends-table-header img {
  width:clamp(38px,13dvh,64px);
  height:auto;
  aspect-ratio:1;
  border:1px solid #e6b986;
  border-radius:9px;
  object-fit:cover;
  object-position:center 15%;
  background:#21192a;
}
.friends-table-header h2 { margin:0; color:#fff4d8; font-size:1.35em; overflow-wrap:anywhere; }
.friends-table-header p { margin:2px 0 0; color:#dcc6d9; font-size:.87em; }
.friends-table-header p.is-online { color:#9df5db; }
.friends-table-header .friends-close { grid-column:3; justify-self:end; }
.friends-table-career, .friends-profile-showcase { min-height:0; overflow:auto; overscroll-behavior:contain; }
.friends-profile-showcase h3 { margin:0 0 5px; color:#fff4d8; font-size:1.05em; }
.friends-profile-showcase .friends-status { margin-top:5px; }
.friends-table-career dl > div, .friends-career-labels {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
}
.friends-career-labels { padding:0 6px 3px; color:#d9bd9e; font-size:.88em; }
.friends-table-career dl { display:grid; gap:2px; margin:0; }
.friends-table-career dl > div { padding:3px 6px; border-radius:4px; background:#1413228c; }
.friends-table-career dd { display:flex; gap:7px; align-items:baseline; margin:0; font-variant-numeric:tabular-nums; }
.friends-table-career dd strong { color:#ffedc9; }
.friends-table-career dd small { min-width:3.8em; color:#d8c5d2; text-align:right; }
.friends-dialog--table footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px; }
.friends-profile-details, .friends-profile-actions { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; }
.friends-profile-details { margin-top:3px; color:#f3dbb4; font-size:.88em; }
.friends-profile-details img { max-width:18px; max-height:18px; }
.friends-profile-actions { flex:none; justify-content:end; margin-inline-start:auto; }

.online-table-profiles { display:flex; flex:none; align-items:center; gap:4px; }
.online-table-profiles[hidden] { display:none; }
#app .online-table-profiles > .online-table-profile {
  box-sizing:border-box;
  width:clamp(26px,9dvh,45px);
  aspect-ratio:1;
  min-width:0;
  min-height:0;
  padding:0;
  overflow:hidden;
  border:1px solid #e7bb7f;
  border-radius:6px;
  background:#21182a;
  cursor:pointer;
  touch-action:manipulation;
}
.online-table-profile img { display:block; width:100%; height:100%; object-fit:cover; object-position:center 15%; }
#app .online-table-profile:focus-visible { outline:2px solid #9df5db; outline-offset:2px; }

@media(max-height:355px) {
  .friends-dialog:not(.friends-dialog--table) { height:94dvh; }
  .friends-dialog :is(button,input) { min-height:28px; }
}
