/* Dialogs must stay usable on small screens after image upload/editor fields are added. */
dialog{max-height:calc(100dvh - 24px);overflow-y:auto}
/* Shared layered Unicode-emoji avatar. */
.avatar-art{width:100%;aspect-ratio:1;position:relative;display:block;overflow:hidden;border-radius:24%;background:linear-gradient(140deg,#ffe0e9,#eadcff);isolation:isolate;container-type:inline-size;flex-shrink:0}
.avatar-face{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif;font-size:66px;font-size:64cqw;line-height:1;white-space:nowrap;z-index:1}
.avatar-layer{position:absolute;inset:0;width:100%;height:100%;z-index:2;pointer-events:none}
.hero-avatar{width:96px;height:96px;position:absolute;right:54px;bottom:35px;z-index:4;transform:rotate(7deg);filter:drop-shadow(0 12px 14px #3d284130)}
.avatar-account-row{display:flex;align-items:center;gap:15px}.avatar-account-row>.avatar-art{width:82px;flex-shrink:0}.profile-actions #editAvatarBtn{flex:1}
.avatar-editor{display:grid;grid-template-columns:152px 1fr;gap:18px;align-items:start}
.avatar-preview{background:linear-gradient(140deg,#fdf0f3,#ede7ff);padding:16px;border-radius:20px;position:sticky;top:0}
.avatar-preview .avatar-art{width:100%}
.avatar-controls{display:grid;gap:11px}
.avatar-controls .field select{width:100%}
.face-picker{display:flex;flex-wrap:wrap;gap:6px}
.face-option{border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:5px;font-size:21px;line-height:1.25}
.face-option[aria-pressed="true"],.hair-swatch[aria-pressed="true"]{outline:2px solid #eb7196;outline-offset:1px}
.color-palette{display:flex;gap:9px;flex-wrap:wrap}
.hair-swatch{width:29px;height:29px;border-radius:50%;border:2px solid #ffffffbb;box-shadow:0 0 0 1px #a9a1a8;cursor:pointer}
.image-upload-picker{display:grid;grid-template-columns:1fr auto;align-items:center;gap:11px}
.upload-preview{width:82px;height:82px;border-radius:12px;background:linear-gradient(145deg,#f9e0eb,#e6e0ff);overflow:hidden;display:grid;place-items:center;color:var(--muted);font-size:27px;border:1px dashed var(--line)}
.upload-preview img{width:100%;height:100%;object-fit:cover}
.upload-help{color:var(--muted);font-size:11px;line-height:1.5;font-weight:400}
.upload-button{width:max-content;max-width:100%}
.nav-actions #themeToggle{padding:10px 11px}
html[data-theme="dark"]{color-scheme:dark;--ink:#f5eef7;--muted:#aaa1b5;--line:#393343;--bg:#171620;--surface:#24212e;--pink:#ee789c;--purple:#a48afa;--shadow:0 12px 38px #05030943}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .topbar{border-color:var(--line)}
html[data-theme="dark"] .link-btn,html[data-theme="dark"] .micro{color:#aea5b6}
html[data-theme="dark"] .btn-primary{background:#ede0f3;color:#211824;box-shadow:none}
html[data-theme="dark"] .btn-primary:hover{background:#fff}
html[data-theme="dark"] .btn-white,html[data-theme="dark"] .btn-ghost,html[data-theme="dark"] .side-card,html[data-theme="dark"] .stat,html[data-theme="dark"] .search-box,html[data-theme="dark"] .tier-row,html[data-theme="dark"] .wish-card,html[data-theme="dark"] dialog,html[data-theme="dark"] .quick-menu,html[data-theme="dark"] .share-option{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .hero{background:linear-gradient(115deg,#452939,#30283f 56%,#383057)}
html[data-theme="dark"] .hero h1,html[data-theme="dark"] .section-title{color:#fff3f7}
html[data-theme="dark"] .hero p{color:#e2cdda}
html[data-theme="dark"] .hero .eyebrow{background:#ffffff18;color:#ffd8e8}
html[data-theme="dark"] .stat strong,html[data-theme="dark"] .stat{color:var(--ink)}
html[data-theme="dark"] .search-box input{color:var(--ink)}
html[data-theme="dark"] .tier-row.drag-over{background:#393146;border-color:#9b7edc}
html[data-theme="dark"] .card-price,html[data-theme="dark"] .side-card p,html[data-theme="dark"] .legend-item,html[data-theme="dark"] .dialog-sub,html[data-theme="dark"] .details-note{color:#b6aabc}
html[data-theme="dark"] .wish-card{box-shadow:none}
html[data-theme="dark"] .card-title,html[data-theme="dark"] .field{color:var(--ink)}
html[data-theme="dark"] .pool-row{background:#292433}
html[data-theme="dark"] .pool-row .tier-label{background:#574769}
html[data-theme="dark"] .side-highlight{background:linear-gradient(145deg,#302944,#423148)}
html[data-theme="dark"] .side-highlight p,html[data-theme="dark"] .side-highlight h3{color:var(--ink)}
html[data-theme="dark"] .side-highlight .btn{background:#4a3d59;color:#fff}
html[data-theme="dark"] .read-banner{background:#392a47;border-color:#574069;color:#e5d9f3}
html[data-theme="dark"] .close,html[data-theme="dark"] .emoji-option,html[data-theme="dark"] .auth-switch,html[data-theme="dark"] .profile-card,html[data-theme="dark"] .details-tier{background:#342f40;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .auth-switch button{color:#c5bbce}
html[data-theme="dark"] .auth-switch button.active{background:#554763;color:#fff}
html[data-theme="dark"] .field input,html[data-theme="dark"] .field textarea,html[data-theme="dark"] .field select,html[data-theme="dark"] .share-link input{background:#302b3a;border-color:#51465a;color:#f6f1f8}
html[data-theme="dark"] .field input::placeholder,html[data-theme="dark"] .field textarea::placeholder{color:#8f8599}
html[data-theme="dark"] .share-option:hover,html[data-theme="dark"] .quick-menu button:hover{background:#382f43}
html[data-theme="dark"] .quick-menu button{color:var(--ink)}
html[data-theme="dark"] .quick-menu hr{background:var(--line)}
html[data-theme="dark"] .form-error,html[data-theme="dark"] .notice{background:#4a293e;border-color:#73465d;color:#ffdce7}
html[data-theme="dark"] .details-price{color:#d6c2d5}
html[data-theme="dark"] .footer strong,html[data-theme="dark"] .footer{color:#a99bad}
html[data-theme="dark"] .avatar-preview{background:#3b304b}
/* Admin uses different class names; keep the same saved theme. */
html[data-theme="dark"] .admin-page .head{border-color:var(--line)}
html[data-theme="dark"] .admin-page .stat,html[data-theme="dark"] .admin-page .panel,html[data-theme="dark"] .admin-page .button,html[data-theme="dark"] .admin-page .search,html[data-theme="dark"] .admin-page .tabs{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .admin-page .tabs{background:#302b3a}
html[data-theme="dark"] .admin-page .tab{color:#c6b8ce}
html[data-theme="dark"] .admin-page .tab[aria-selected="true"]{background:#564862;color:#fff}
html[data-theme="dark"] .admin-page .data-table th{background:#342d3e;color:#d2c7d7}
html[data-theme="dark"] .admin-page .data-table td{border-color:var(--line)}
html[data-theme="dark"] .admin-page .intro p,html[data-theme="dark"] .admin-page .sub,html[data-theme="dark"] .admin-page .count,html[data-theme="dark"] .admin-page .foot{color:#b4a7ba}
html[data-theme="dark"] .admin-page .pill,html[data-theme="dark"] .admin-page .status.role{background:#4a3b5b;color:#e9d5ff}
html[data-theme="dark"] .admin-page .status.active{background:#264238;color:#a8e9bf}
html[data-theme="dark"] .admin-page .status.inactive{background:#4c2839;color:#ffb6cb}
html[data-theme="dark"] .admin-page .button.black{background:#e9dcf1;color:#2a2030}
html[data-theme="dark"] .admin-page .button.solid{background:#dc688b;color:white}
html[data-theme="dark"] .admin-page .gift-emoji{background:#443148}
html[data-theme="dark"] .admin-page .tier{background:#4b354f;color:#fff}
html[data-theme="dark"] .admin-page #error{background:#4c2637;color:#ffbad0;border-color:#73485a}
@media(max-width:700px){.hero-avatar{width:69px;height:69px;right:18px;bottom:20px;opacity:.9}.avatar-editor{grid-template-columns:115px minmax(0,1fr);gap:10px}.avatar-preview{padding:7px}.nav-actions #themeToggle{font-size:11px;padding:9px 8px}.image-upload-picker{grid-template-columns:1fr auto}}
@media(max-width:430px){.hero-avatar{width:56px;height:56px;right:10px;bottom:10px}.avatar-editor{grid-template-columns:1fr}.avatar-preview{position:static;width:150px;margin:auto}.avatar-controls{grid-template-columns:1fr 1fr}.face-picker,.color-palette{grid-column:1/-1}}

.terms-check{display:flex;gap:10px;align-items:flex-start;font-size:12px;line-height:1.6;color:var(--muted)}.terms-check input{width:16px;height:16px;flex:none;margin-top:3px;accent-color:#f37094}.terms-check a,.upload-legal a{text-decoration:underline;color:#bf5c83}.upload-legal{font-size:11px;line-height:1.6;margin:-4px 0 2px;color:var(--muted)}.foot a{text-decoration:underline;color:inherit}
