#profile-card {
  --signal:#aadccc; --muted:#a9bac0;
  position:absolute; z-index:4; inset:50% clamp(12px,2.4vw,36px) auto auto;
  transform:translateY(-50%); margin:0; width:min(340px,38vw);
  max-height:calc(100dvh - 152px); overflow:auto; overscroll-behavior:contain;
  padding:0; color:#eaf1f2; color-scheme:dark; scrollbar-width:thin;
  background:linear-gradient(125deg,#1c292f,#10171d 45%,#152126);
  border:1px solid #718487; border-top:3px solid var(--signal);
  box-shadow:inset 0 0 0 3px #0e151a,0 12px 30px #04090d70;
}
#profile-card[data-cat=boss]{--signal:#ebc27d}
#profile-card[data-cat=wick]{--signal:#e8a4c9}
#profile-card[data-cat=byte]{--signal:#68e4d7}
.file-bar{display:flex;align-items:center;justify-content:space-between;padding:4px 8px 4px 18px;border-bottom:1px solid #47585e;background:repeating-linear-gradient(0deg,#172228 0 2px,#1c272d 2px 3px)}
.file-bar span,.file-close,#profile-card .cat-role,#profile-card .cat-stories-label{font:600 .8rem/1.4 ui-monospace,monospace;letter-spacing:.08em;text-transform:uppercase}
.file-bar span{color:var(--signal)}
.file-close{display:grid;place-items:center;width:44px;height:44px;border:0;background:transparent;color:#dbe5e8;font-size:1.55rem}
#profile-card .cat-profile{position:relative;padding:16px 21px 19px;display:flow-root}
#profile-card .cat-avatar{float:right;width:77px;height:68px;object-fit:cover;margin:0 0 8px 12px;border:1px solid var(--signal);box-shadow:3px 3px 0 #314047}
#profile-card .cat-role{margin:0;color:var(--signal)}
#profile-card h3{margin:4px 0 15px;font:800 clamp(32px,3.8vw,52px)/1 system-ui,sans-serif;letter-spacing:-.05em}
#profile-card .cat-beat{clear:both;border-top:1px solid #4d5e66;padding-top:12px;color:#e5ecee;font-weight:650}
#profile-card p{line-height:1.44;margin:.65em 0}
#profile-card blockquote{margin:1em 0;padding-left:12px;border-left:2px solid var(--signal);color:var(--signal);font:italic 1.16rem/1.3 Georgia,serif}
#profile-card .cat-stories-label,#profile-card .cat-no-stories{color:var(--muted)}
#profile-card .cat-no-stories{font-size:.92rem;margin-bottom:0}
#profile-card a{text-decoration:underline;text-underline-offset:3px}
#profile-card[open] .cat-profile::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:0;background:linear-gradient(180deg,transparent 45%,var(--signal) 50%,transparent 55%);background-size:100% 200%}
@media (max-width:700px) and (orientation:portrait){
  #profile-card{inset:auto 10px max(9px,env(safe-area-inset-bottom));width:auto;max-height:46dvh;transform:none}
  #profile-card .cat-profile{padding:9px 16px 15px}
  #profile-card .cat-avatar{height:48px;width:55px}
  #profile-card h3{font-size:32px;margin:2px 0 8px}
  #profile-card .cat-beat{padding-top:7px}
}
@media(max-height:500px) and (orientation:landscape){
  #profile-card{max-height:86dvh;inset-inline-end:8px;width: min(320px,40vw)}
}
@media(prefers-reduced-motion:no-preference){
  #profile-card[open]{animation:file-acquire .16s ease-out both}
  #profile-card[data-cat=byte][open] .cat-profile::after{animation:decrypt-sweep .32s ease-out}
  #profile-card[open] .cat-profile-copy{animation:ink-in .2s ease-out both}
  #profile-card[data-closing=true]{animation:file-away .09s ease-in both}
  @keyframes file-acquire{from{opacity:.2;clip-path:inset(0 0 70% 0)}to{opacity:1;clip-path:inset(0)}}
  @keyframes file-away{to{opacity:0;clip-path:inset(0 0 35% 0)}}
  @keyframes ink-in{from{opacity:.3;translate:0 3px}to{opacity:1;translate:0 0}}
  @keyframes decrypt-sweep{from{background-position:0 100%;opacity:.28}to{background-position:0 0;opacity:0}}
}
#profile-card .file-bar{position:sticky;top:0;z-index:1}
#profile-card .cat-profile-copy{font-size:.98rem}
#profile-card .cat-voice{color:var(--muted);font-size:.88rem}
#world:has(#profile-card[open]) #hint{visibility:hidden}
@media(max-width:700px) and (orientation:portrait){
  #world:has(#profile-card[open]) #cat-picker{position:fixed;top:max(62px,env(safe-area-inset-top));left:12px;right:auto;gap:4px;margin:0}
  #world:has(#profile-card[open]) #cat-picker .btn{min-height:36px;padding:4px 8px}
  #world:has(#profile-card[open]) footer .controls{visibility:hidden}
}
