/* A separate, full-height mobile surface; never inherit the app's bottom sheet. */
dialog.character-profile{position:fixed;inset:auto;top:var(--viewport-top,0px);left:0;right:0;bottom:auto;width:min(100%,var(--app-width,430px));height:var(--viewport-height,100dvh);min-height:0;max-width:430px;max-height:none;margin:0 auto;padding:0;overflow:hidden;transform:none;border:0;border-radius:0;background:#fff;color:#24282b;box-shadow:0 0 0 1px #0000000d;overscroll-behavior:none;-webkit-font-smoothing:antialiased}
dialog.character-profile::before{display:none;content:none}
dialog.character-profile::backdrop{background:#20252c4d}
.character-profile .cp-shell,.character-profile .cp-screen{position:relative;width:100%;height:100%;min-height:0}
.character-profile .cp-screen[hidden]{display:none!important}
.character-profile button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.character-profile button:disabled{cursor:default}
.character-profile button:focus-visible{outline:2px solid var(--primary,#2c7fff);outline-offset:4px}
.character-profile svg{display:block;width:24px;height:24px;flex-shrink:0}
.character-profile .cp-icon-button{display:grid;place-items:center;width:44px;min-width:44px;height:44px;padding:10px;border:0;border-radius:50%;background:transparent}
.character-profile .cp-profile-scroll{height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-width:none;background:#32383d;-webkit-overflow-scrolling:touch}
.character-profile .cp-profile-main{position:relative;display:flex;flex-direction:column;justify-content:flex-end;min-height:100%;padding:calc(80px + env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom));isolation:isolate}
.character-profile .cp-profile-scroll::-webkit-scrollbar,.character-profile .cp-album-scroll::-webkit-scrollbar{display:none}
.character-profile .cp-cover{position:absolute;inset:0;z-index:-1;display:block;width:100%;height:100%;min-height:44px;padding:0;overflow:hidden;background:#58656b}
.character-profile .cp-cover::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#15202a28 0%,#15202a00 23%,#15202a05 38%,#141c284d 61%,#0c162599 83%,#0b1427b8 100%);pointer-events:none}
.character-profile .cp-cover-image{display:block;width:100%;height:100%;object-fit:cover}
.character-profile .cp-cover.cp-no-photo{background:linear-gradient(150deg,#8cabb7,#536777)}
.character-profile .cp-no-photo .cp-cover-image,.character-profile .cp-no-photo .cp-cover-hint{display:none}
.character-profile .cp-cover-hint{position:absolute;right:18px;top:calc(17px + env(safe-area-inset-top));z-index:1;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#17222c45;color:#fff}
.character-profile .cp-cover-hint svg{width:17px;height:17px}
.character-profile .cp-profile-close{position:absolute;z-index:3;left:calc(10px + env(safe-area-inset-left));top:calc(8px + env(safe-area-inset-top));color:#fff;background:#17222c45}
.character-profile .cp-profile-close:focus-visible{outline-color:#fff;outline-offset:3px}
.character-profile .cp-identity{position:relative;display:flex;flex-direction:column;align-items:flex-start;margin-top:auto;padding:0 22px;text-align:left;color:#fff;pointer-events:none}
.character-profile .cp-portrait{position:relative;display:block;width:76px;height:76px;min-height:44px;padding:0;overflow:hidden;flex-shrink:0;border:1px solid #ffffff90;border-radius:38%;background:#ece8e4;pointer-events:auto}
.character-profile .cp-portrait img{display:block;width:100%;height:100%;object-fit:cover}
.character-profile .cp-name{margin:13px 0 0;font-size:24px;font-weight:700;line-height:1.35;letter-spacing:-.6px;overflow-wrap:anywhere}
.character-profile .cp-status{max-width:100%;margin:8px 0 0;font-size:14px;line-height:1.65;color:#fffffff0;white-space:pre-wrap;word-break:keep-all;overflow-wrap:anywhere}
.character-profile .cp-actions{position:relative;display:flex;justify-content:center;gap:0;margin:25px 20px 0;padding:0;border:1px solid #ffffff64;border-radius:10px;color:#fff;background:#ffffff08;overflow:hidden}
.character-profile .cp-action{position:relative;display:flex;flex:1;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:49px;padding:10px 12px;font-size:14px;font-weight:500;line-height:1.45;background:transparent;color:#fff}
.character-profile .cp-action+.cp-action::before{content:"";position:absolute;left:0;top:50%;height:22px;transform:translateY(-50%);border-left:1px solid #ffffff5c}
.character-profile .cp-action:focus-visible{outline-offset:-4px;outline-color:#fff}
.character-profile .cp-action svg{width:22px;height:22px;color:#fff}
.character-profile .cp-album,.character-profile .cp-viewer{display:flex;flex-direction:column}
.character-profile .cp-page-header{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-shrink:0;min-height:calc(64px + env(safe-area-inset-top));padding:calc(7px + env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 7px max(10px,env(safe-area-inset-left));background:#fff;color:#252b31}
.character-profile .cp-page-header h2{min-width:0;margin:0;font-size:16px;line-height:1.4;font-weight:600;letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
.character-profile .cp-header-spacer{width:44px;flex-shrink:0}
.character-profile .cp-album-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 0 env(safe-area-inset-bottom);scrollbar-width:none}
.character-profile .cp-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;align-items:start}
.character-profile .cp-photo-tile{display:block;width:100%;min-width:0;min-height:44px;padding:0;border:0;border-radius:0;background:none}
.character-profile .cp-photo-tile:focus-visible{position:relative;z-index:1;outline-offset:-3px}
.character-profile .cp-photo-frame{display:block;width:100%;aspect-ratio:1;overflow:hidden;background:#f1eeea}
.character-profile .cp-photo-frame img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .2s ease}
.character-profile .cp-viewer{background:#17191c;color:#fff}
.character-profile .cp-viewer-header{background:#17191c;color:#fff}
.character-profile .cp-viewer-meta{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;text-align:center}
.character-profile .cp-uploaded-at{color:#e5e7ea;font-size:13px;line-height:1.4;white-space:nowrap;font-variant-numeric:tabular-nums}
.character-profile .cp-uploaded-at[hidden]{display:none}
.character-profile .cp-viewer-counter{flex-shrink:0;min-width:44px;text-align:center;color:#c7cbcf;font-size:12px;font-variant-numeric:tabular-nums}
.character-profile .cp-viewer-stage{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-height:0;margin-bottom:env(safe-area-inset-bottom);overflow:hidden;touch-action:pan-y pinch-zoom}
.character-profile .cp-viewer-image{display:block;max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-select:none;-webkit-user-drag:none}
.character-profile .cp-image-error{position:absolute;inset:40% 20px auto;margin:0;color:#c7cbcf;text-align:center;font-size:14px;line-height:1.6}
.character-profile .cp-photo-arrow{position:absolute;top:50%;transform:translateY(-50%);flex-shrink:0;background:#11171f6e;color:#fff}
.character-profile .cp-photo-previous{left:8px}
.character-profile .cp-photo-next{right:8px}
.character-profile .cp-photo-arrow:disabled{opacity:.25}
.character-profile .cp-visually-hidden{position:absolute!important;width:1px;max-width:1px;height:1px;padding:0;margin:-1px!important;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.character-profile.cp-closing{pointer-events:none}
@media(hover:hover){.character-profile .cp-action:hover{background:#ffffff14}.character-profile .cp-page-header .cp-icon-button:hover{background:#8995a21a}.character-profile .cp-photo-tile:hover img{transform:scale(1.025)}}
@media(prefers-reduced-motion:reduce){.character-profile,.character-profile *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
