/* The supplied art stays decorative: names, portraits and all controls are live. */
#social-friends-strip {
  --sf-card-width: 108px;
  --sf-card-height: 126px;
  position: fixed;
  z-index: 71100;
  left: 10px;
  right: 10px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: auto;
  max-width: none;
  color: #60391d;
  font-family: Arial, sans-serif;
}
#social-friends-strip[hidden] { display: none; }
#social-friends-strip.sf-visiting { bottom: calc(4px + env(safe-area-inset-bottom)); }
#social-friends-strip .sf-strip-shell {
  padding: 23px 23px 19px;
  border: 0;
  border-radius: 0;
  background: url('assets/friends-ui/raster/panel_friends.png') center / 100% 100% no-repeat;
  box-shadow: none;
}
.sf-strip-head { display:flex; align-items:center; gap:14px; padding:0 10px; min-height:37px; margin:0 0 5px; }
.sf-strip-head strong { color:#fff3d8; font:700 26px/1.1 Georgia,serif; text-shadow:0 2px 3px #51311d; }
.sf-strip-head > span { color:#60391d; padding:5px 13px; border-radius:16px; background:#fff0ce; font-size:12px; font-weight:700; }
.sf-strip-close { margin-left:auto; min-height:34px; padding:5px 15px; border:1px solid #9c683c; border-radius:14px; color:#60391d; background:linear-gradient(#fff6df,#e8c07e); font-weight:700; cursor:pointer; }
.sf-strip-ornaments { display:none; }
.sf-strip-scroll-row { align-items:center; gap:9px; }
.sf-strip-rail { gap:8px; padding:3px 2px; align-items:center; scroll-padding-inline:3px; scrollbar-width:thin; scrollbar-color:#a7d5ec transparent; }
.sf-strip-tile { width:var(--sf-card-width); flex:0 0 var(--sf-card-width); }
.sf-strip-friend {
  display:block; position:relative; width:var(--sf-card-width); height:var(--sf-card-height); padding:0;
  border:0; border-radius:12px; background: url('assets/friends-ui/raster/card_friend.png') center / 100% 100% no-repeat;
  box-shadow:none; color:#60391d; text-shadow:none; overflow:visible;
}
.sf-strip-friend > img { position:absolute; top:12%; left:13%; width:74%; height:63%; border:0; border-radius:9px; object-fit:contain; object-position:center bottom; background:#315a8b; }
.sf-strip-name { position:absolute; bottom:8%; left:10%; width:80%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font:700 11px/1.2 Arial,sans-serif; color:#60391d; }
.sf-strip-level { position:absolute; right:7%; bottom:23%; min-width:19px; height:19px; display:grid; place-items:center; padding:1px; border:1px solid #ffeaf4; border-radius:50%; background:linear-gradient(#f099d5,#b848a3); color:#fff; font-size:11px; }
.sf-strip-more { left:5%; top:5%; width:26px; height:26px; border:0; border-radius:50%; background: url('assets/friends-ui/icons/icon_more.svg') center / contain no-repeat; color:transparent; cursor:pointer; }
.sf-strip-claimed { left:auto; right:6%; top:7%; min-width:19px; min-height:19px; border-radius:50%; background:#27674d; color:white; }
.sf-strip-friend[aria-current="true"] { filter:drop-shadow(0 0 4px #3ba6dc); }
.sf-strip-action { flex:0 0 var(--sf-card-width); width:var(--sf-card-width); height:var(--sf-card-height); position:relative; border:0; border-radius:12px; background: url('assets/friends-ui/raster/card_action.png') center / 100% 100% no-repeat; padding:76px 10px 17px; color:#60391d; font:700 12px/1.2 Arial,sans-serif; }
.sf-strip-action::before { content:''; position:absolute; left:50%; top:17%; transform:translateX(-50%); width:48px; height:48px; background:center / contain no-repeat; }
.sf-add-friend::before { background-image:url('assets/friends-ui/icons/icon_add.svg'); }
.sf-invite::before { background-image:url('assets/friends-ui/icons/icon_invite.svg'); }
.sf-strip-arrow { flex:0 0 32px; width:32px; height:62px; padding:0; border:0; border-radius:14px; color:transparent; background: url('assets/friends-ui/icons/icon_chevron_left.svg') center / contain no-repeat; box-shadow:none; }
.sf-strip-arrow:last-child { background-image:url('assets/friends-ui/icons/icon_chevron_right.svg'); }
.sf-strip-arrow:disabled { opacity:.45; cursor:default; }
#social-friends-strip button:focus-visible, #social-friends-overlay button:focus-visible { outline:2px solid #8ad8ff; outline-offset:2px; }
.sf-strip-feedback { font-size:12px; padding:4px 10px; margin-top:4px; }
.sf-own-code { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-top:16px; padding-top:12px; border-top:1px solid #bcd6e5; }
.sf-own-code strong { font-size:24px; color:#285b80; letter-spacing:1px; }
.sf-box > .sf-btn { margin:7px 5px 0 0; }
.sf-link { box-sizing:border-box; width:100%; min-width:0; }
#social-friends-overlay.sf-guest-open .sf-header { border-bottom:0; }
.sf-guest-object:hover { outline:none; filter:drop-shadow(0 5px 3px #233b5170); }
.sf-guest-object:focus-visible { outline:2px solid #8ad8ff; filter:drop-shadow(0 0 5px #68bfea); }
.sf-guest-viewport:focus { outline:none; }
.sf-guest-viewport:focus-visible { outline:2px solid #8ad8ff; outline-offset:-2px; }
.sf-guest-object.sf-guest-legacy { transform:translate(-50%,-50%); }
.sf-guest-house-2 { --sf-house-height:82%; }
.sf-guest-house > img { bottom:var(--sf-house-bottom,0); }
.sf-guest-house-2 { --sf-house-bottom:-1.18px; }
.sf-guest-house-3 { --sf-house-bottom:-17.6px; }
.sf-guest-house-4 { --sf-house-bottom:-31.7px; }
.sf-guest-house-5 { --sf-house-bottom:-29.6px; }
.sf-guest-house-6 { --sf-house-bottom:-12.9px; }
@media(min-width:1600px) {
  #social-friends-strip { --sf-card-width:120px; --sf-card-height:138px; }
}
@media(max-width:700px) {
  #social-friends-strip { --sf-card-width:86px; --sf-card-height:102px; left:3px; right:3px; bottom:calc(72px + env(safe-area-inset-bottom)); }
  #social-friends-strip .sf-strip-shell { padding:17px 10px 12px; }
  .sf-strip-head { padding:0 7px; gap:6px; min-height:32px; margin-bottom:2px; }
  .sf-strip-head strong { font-size:20px; }
  .sf-strip-head > span { padding:4px 6px; font-size:10px; }
  .sf-strip-close { font-size:11px; padding:4px 7px; min-height:30px; }
  .sf-strip-arrow { flex-basis:25px; width:25px; height:49px; }
  .sf-strip-scroll-row { gap:4px; }
  .sf-strip-rail { gap:5px; }
  .sf-strip-name { font-size:10px; }
  .sf-strip-action { padding:62px 7px 12px; font-size:10px; }
  .sf-strip-action::before { width:36px; height:36px; }
  .sf-strip-level { width:17px; height:17px; min-width:17px; font-size:10px; }
  .sf-strip-more { width:24px; height:24px; }
  .sf-tools { grid-template-columns:1fr; }
  .sf-form { flex-wrap:wrap; }
  .sf-form input { min-width:0; width:100%; }
  .sf-guest-footer { padding:3px 6px; gap:3px 6px; }
  #social-friends-overlay.sf-guest-open .sf-guest-footer .sf-object-info { font-size:10px; }
}
@media(max-height:500px) and (orientation:landscape) {
  #social-friends-strip { --sf-card-width:62px; --sf-card-height:64px; bottom:calc(58px + env(safe-area-inset-bottom)); }
  #social-friends-strip .sf-strip-shell { padding:8px 14px 6px; }
  .sf-strip-rail { padding-top:0; padding-bottom:0; }
  .sf-strip-head { min-height:22px; margin-bottom:0; padding-bottom:0; }
  .sf-strip-head strong { font-size:18px; }
  .sf-strip-head > span { font-size:10px; padding:3px 8px; }
  .sf-strip-close { min-height:22px; padding:1px 9px; font-size:10px; }
  .sf-strip-action { padding:35px 5px 6px; font-size:9px; }
  .sf-strip-action::before { width:24px; height:24px; }
  .sf-strip-name { font-size:9px; }
  .sf-strip-more { width:20px; height:20px; }
  .sf-strip-arrow { height:42px; flex-basis:25px; }
  .sf-guest-help { padding:0 6px; font-size:10px; }
  #social-friends-overlay.sf-guest-open .sf-header { min-height:34px; padding:2px 8px; }
  #social-friends-overlay.sf-guest-open .sf-header h2 { font-size:16px; }
  #social-friends-overlay.sf-guest-open .sf-header .sf-btn { min-height:30px; }
  #social-friends-overlay.sf-guest-open .sf-object-info { font-size:10px; }
  .sf-guest-footer { padding:2px 6px; }
  .sf-guest-footer .sf-guest-claim { min-height:28px; padding:3px 8px; font-size:11px; }
}

/* M3: keep the illustrated tray, with an optional one-row mobile state. */
.sf-strip-toggle { display:none; }
#social-friends-overlay .sf-busy .sf-close { pointer-events:auto;opacity:1; }
#social-friends-quick {
 position:fixed;inset:auto;bottom:auto;z-index:71110;box-sizing:border-box;
 overflow:auto;overscroll-behavior:contain;scroll-padding-block:64px 12px;
}
#social-friends-quick .sf-quick-head { position:sticky;top:-11px;gap:8px;padding:4px 0;background:#fff0d6;z-index:1; }
#social-friends-quick .sf-quick-head strong { flex:1;min-width:0;overflow-wrap:anywhere; }
#social-friends-quick .sf-quick-x { flex:0 0 44px;min-width:44px;min-height:44px;padding:0; }
#social-friends-quick .sf-btn { min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere; }
.sf-detail { padding:10px;margin-top:6px;border:2px solid #bd8b4e;border-radius:12px;background:#fff1d6;color:#654229;overflow-wrap:anywhere; }
.sf-detail p { margin:5px 0; }
.sf-detail button { min-height:44px; }
.sf-empty { margin:4px 0 8px;color:#60391d; }
:root[data-window-layout="compact"] #social-friends-strip {
 --sf-card-width:144px;--sf-card-height:96px;
 left:calc(var(--app-viewport-left,0px) + var(--window-left) + 6px);right:auto;top:auto;
 bottom:calc(100dvh - var(--app-viewport-top,0px) - var(--window-viewport) + var(--window-bottom) + 58px);
 width:var(--window-width);max-width:var(--window-width);max-height:max(52px,calc(var(--window-height) - 58px));
 pointer-events:auto;
}
:root[data-window-layout="compact"] #social-friends-strip.sf-visiting {
 bottom:calc(100dvh - var(--app-viewport-top,0px) - var(--window-viewport) + var(--window-bottom) + 6px);
 width:var(--window-width);max-width:var(--window-width);max-height:var(--window-height);
}
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-shell {
 display:flex;flex-direction:column;box-sizing:border-box;max-height:inherit;
 padding:8px 12px;border-radius:14px;
}
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-head {
 display:flex;align-items:center;flex:0 0 auto;min-width:0;gap:6px;min-height:44px;margin:0;padding:0;
}
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-head strong { font-size:18px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-head>span { min-width:0;flex:1;padding:3px 6px;font-size:12px;line-height:1.2; }
:root[data-window-layout="compact"] #social-friends-strip :is(.sf-strip-toggle,.sf-strip-close) {
 display:block;flex:0 0 auto;min-width:44px;min-height:44px;margin:0;padding:4px 8px;
 border:1px solid #9c683c;border-radius:12px;color:#60391d;background:linear-gradient(#fff6df,#e8c07e);font:700 12px Arial,sans-serif;
}
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-body { min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:8px; }
:root[data-window-layout="compact"] #social-friends-strip[data-collapsed="true"] .sf-strip-body { display:none; }
:root[data-window-layout="compact"] #social-friends-strip[data-collapsed="true"] .sf-strip-shell { padding:4px 8px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-scroll-row { gap:4px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-rail {
 align-items:stretch;min-width:0;gap:6px;padding:3px 0 6px;overflow-x:auto;overflow-y:hidden;
 scroll-behavior:smooth;touch-action:pan-x pan-y;scroll-snap-type:x proximity;scrollbar-width:thin;
}
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-tile {
 display:flex;align-items:center;flex:0 0 144px;width:144px;height:96px;
 background:url('assets/friends-ui/raster/card_friend.png') center/100% 100% no-repeat;
}
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-friend { flex:1;min-width:0;width:96px;height:96px;background:none; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-friend>img { top:7px;left:calc(50% - 24px);width:48px;height:48px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-name {
 display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;
 left:5px;bottom:7px;width:calc(100% - 10px);height:29px;white-space:normal;overflow-wrap:anywhere;
 font:700 12px/1.2 Arial,sans-serif;text-align:center;
}
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-level { top:38px;right:5px;bottom:auto;min-width:20px;height:20px;font-size:11px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-more { position:static;flex:0 0 44px;width:44px;height:44px;margin-right:4px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-action { flex:0 0 144px;width:144px;height:96px;padding:52px 8px 6px;font-size:13px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-action::before { top:12px;width:32px;height:32px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-arrow { flex:0 0 44px;width:44px;height:44px;min-height:44px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-pending { min-height:44px;margin:4px 0;padding:5px 10px; }
:root[data-window-layout="compact"] #social-friends-strip .sf-strip-feedback { font-size:13px;line-height:1.3; }
:root[data-window-layout="compact"][data-window-height="short"] #social-friends-strip:not(.sf-visiting)[data-collapsed="false"] {
 bottom:calc(100dvh - var(--app-viewport-top,0px) - var(--window-viewport) + var(--window-bottom) + 6px);max-height:var(--window-height);
}
:root[data-window-layout="compact"] #social-friends-overlay:not(.sf-guest-open) .sf-header { margin:0 0 8px;background:#fff4df; }
:root[data-window-layout="compact"] #social-friends-overlay:not(.sf-guest-open) .sf-header h2 { min-width:0;overflow-wrap:anywhere; }
:root[data-window-layout="compact"] #social-friends-overlay .sf-busy .sf-close { pointer-events:auto;opacity:1; }
:root[data-window-layout="compact"] #social-friends-overlay .sf-tools { grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
:root[data-window-layout="compact"] #social-friends-overlay :is(.sf-box,.sf-section) { min-width:0;padding:10px;margin:6px 0; }
:root[data-window-layout="compact"] #social-friends-overlay :is(.sf-btn,input) { box-sizing:border-box;min-height:44px;max-width:100%; }
:root[data-window-layout="compact"] #social-friends-overlay .sf-request { flex-wrap:wrap;gap:6px; }
:root[data-window-layout="compact"] #social-friends-overlay .sf-request span { min-width:0;flex:1 1 100%;overflow-wrap:anywhere; }
:root[data-window-layout="compact"] #social-friends-overlay .sf-own-code { gap:6px;margin-top:10px;padding-top:8px; }
:root[data-window-layout="compact"] #social-friends-overlay .sf-own-code strong { font-size:20px;overflow-wrap:anywhere; }
@media(prefers-reduced-motion:reduce) { .sf-strip-rail { scroll-behavior:auto !important; } }
