#app { min-height: 100dvh; }
.app-shell { min-height: 100dvh; padding: 0 max(1rem, env(safe-area-inset-right)) calc(5.8rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
.page { width: min(100%, 1240px); margin: 0 auto; }
.topbar, .studio-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; position: relative; z-index: 5; }
.topbar--overlay { margin-bottom: -68px; }
.topbar--solid { border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 900; letter-spacing: -.035em; }
.brand-logo { height: 28px; width: auto; max-width: min(42vw, 180px); }
.brand-logo--login { height: 42px; max-width: min(80vw, 260px); }
.brand-logo--kicker { height: 16px; max-width: 96px; }
.studio-badge { padding-left: .65rem; border-left: 1px solid #555; color: #eee; font-size: .73rem; letter-spacing: .15em; font-weight: 800; }
.studio-brand { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; }
.avatar-button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: linear-gradient(145deg, #6254e8, #282078); }
.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding: 0 max(.5rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(.5rem, env(safe-area-inset-left)); display: grid; background: rgba(8,8,8,.94); border-top: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(20px); }
.bottom-nav--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.bottom-nav--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.bottom-nav a { min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; color: #888; font-size: .67rem; font-weight: 700; }
.bottom-nav a[aria-current="page"] { color: #fff; }
.bottom-nav .nav-icon { height: 25px; display: grid; place-items: center; font-size: 1.15rem; }
.bottom-nav a[aria-current="page"] .nav-icon { transform: scale(1.05); }
.login-page { min-height: 100dvh; display: grid; align-items: center; padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(0,0,0,.35), #080808), radial-gradient(circle at 50% 0%, #3d070b, transparent 48%), var(--bg); }
.login-card { width: min(100%, 450px); margin: auto; border: 1px solid var(--line); border-radius: 10px; background: rgba(12,12,12,.94); padding: clamp(1.6rem, 6vw, 3rem); box-shadow: var(--shadow); }
.login-card > .brand-logo--login { margin-bottom: clamp(2rem, 8vh, 3.5rem); }
.brand--login { margin-bottom: clamp(3rem, 10vh, 5.5rem); }
.login-copy { margin-bottom: 1.6rem; }
.login-copy h1 { font-size: clamp(2rem, 8vw, 3rem); }
.stack { display: grid; gap: 1rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.loading-page { min-height: 70dvh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.account-hero { min-height: 220px; display: flex; align-items: center; gap: 1.25rem; padding: 2rem 0; }
.account-hero h1 { margin-bottom: .45rem; }
.account-hero p { margin-bottom: 0; }
.profile-avatar { width: 86px; height: 86px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #6254e8, #21195f); font-size: 2.2rem; }
.profile-avatar svg { stroke-width: 1.2; }
.role-pill { color: #aaa; font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.settings-card { border-top: 1px solid var(--line); }
.settings-row { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.settings-row p { margin: .25rem 0 0; font-size: .84rem; }
.settings-row--link > span { color: #777; }
.profiles-card { width: min(100%, 720px); text-align: center; }
.profiles-card h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin-bottom: 1.6rem; }
.profiles-message { color: #f3a4a4; margin-bottom: 1rem; }
.profiles-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem; }
.profile-tile { display: flex; flex-direction: column; align-items: center; gap: .6rem; width: 140px; background: transparent; border: 0; color: inherit; cursor: pointer; position: relative; }
.profile-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.profile-tile__name { font-size: .85rem; font-weight: 700; }
.profile-tile__actions { position: absolute; top: -.4rem; right: 12px; display: flex; gap: .3rem; }
.profile-tile__actions .icon-button { width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.profile-avatar-circle { border-radius: 50%; display: block; }
.profile-avatar-circle--add { display: grid; place-items: center; background: #222; border: 2px dashed #555; font-size: 2rem; color: #aaa; }
.profile-tile--form { width: 240px; background: rgba(20,20,20,.7); border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem; text-align: left; }
.avatar-picker { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.avatar-picker legend { color: #d4d4d4; font-size: .84rem; font-weight: 750; margin-bottom: .4rem; }
.avatar-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.avatar-swatch--selected { border-color: #fff; }
.profile-form-actions { display: flex; gap: .6rem; justify-content: flex-end; }
.profiles-limit-message { color: #aaa; font-size: .85rem; width: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 760px) { .app-shell { padding-inline: 2.5rem; } }
@media (min-width: 980px) {
  .app-shell { padding-bottom: 2rem; }
  .page { padding-bottom: 3rem; }
  .bottom-nav { left: 50%; right: auto; bottom: 1rem; transform: translateX(-50%); width: auto; min-width: 310px; height: 54px; padding: 0 .35rem; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
  .bottom-nav a { min-height: 52px; padding: 0 1.25rem; flex-direction: row; gap: .45rem; font-size: .75rem; }
  .bottom-nav .nav-icon { height: auto; }
}

/* Profile chooser: an original, large-format profile experience. */
.profiles-page { background: radial-gradient(circle at 15% 12%, rgba(190,24,93,.24), transparent 30%), radial-gradient(circle at 85% 85%, rgba(37,99,235,.2), transparent 34%), #090909; }
.profiles-card { width: min(100%, 920px); padding: clamp(1.75rem, 5vw, 3.4rem); border-color: rgba(255,255,255,.12); background: rgba(13,13,15,.9); }
.profiles-card .brand--login { margin-bottom: clamp(2rem, 6vh, 4rem); }
.profiles-kicker { margin: 0 0 .5rem; color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.profiles-card h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.05em; }
.profiles-subtitle { margin: .65rem 0 2.25rem; color: #a3a3a3; }
.profiles-grid { gap: clamp(1.25rem, 4vw, 2.4rem); align-items: flex-start; }
.profile-tile { width: min(30vw, 156px); min-width: 112px; gap: .45rem; padding: 0; border: 0; background: transparent; color: #fff; text-align: center; }
.profile-avatar-art { display: block; overflow: hidden; border-radius: 18%; box-shadow: 0 10px 28px rgba(0,0,0,.32); transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.profile-avatar-art svg { display: block; width: 100%; height: 100%; }
.profile-avatar-art--compact { border-radius: 16px; }
.profile-tile:hover .profile-avatar-art, .profile-tile:focus-visible .profile-avatar-art { transform: scale(1.06); box-shadow: 0 16px 36px rgba(0,0,0,.55); filter: saturate(1.12); }
.profile-tile:focus-visible { outline: 0; }
.profile-tile:focus-visible .profile-avatar-art { outline: 3px solid #fff; outline-offset: 4px; }
.profile-tile__name { font-size: .98rem; font-weight: 800; line-height: 1.2; }
.profile-tile__hint { color: #8f8f8f; font-size: .72rem; line-height: 1; }
.profile-tile__edit { display: inline-flex; align-items: center; justify-content: center; min-height: 27px; padding: 0 .55rem; margin-top: .2rem; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; color: #d4d4d4; font-size: .68rem; font-weight: 800; opacity: 0; transform: translateY(-3px); transition: opacity .18s ease, transform .18s ease, background .18s ease; }
.profile-tile:hover .profile-tile__edit, .profile-tile:focus-within .profile-tile__edit { opacity: 1; transform: translateY(0); }
.profile-tile__edit:hover { background: #fff; color: #111; }
.profile-tile--add { min-height: 188px; justify-content: center; border: 1px dashed rgba(255,255,255,.3); border-radius: 18px; background: rgba(255,255,255,.025); transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.profile-tile--add:hover, .profile-tile--add:focus-visible { background: rgba(255,255,255,.07); border-color: #fff; transform: translateY(-3px); }
.profile-add-mark { display: grid; width: 66px; height: 66px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 2.5rem; font-weight: 300; line-height: 1; }
.profile-editor { width: min(100%, 620px); padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.04); text-align: left; }
.profile-editor__head { display: flex; align-items: center; gap: 1rem; }
.profile-editor__head h2 { margin: .2rem 0 0; font-size: 1.35rem; }
.avatar-picker { display: grid; gap: .75rem; }
.avatar-picker legend { font-size: .9rem; font-weight: 800; }
.avatar-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.avatar-option { position: relative; display: grid; justify-items: center; gap: .35rem; padding: .55rem .25rem .45rem; border: 1px solid transparent; border-radius: 12px; background: rgba(255,255,255,.035); color: #d4d4d4; font-size: .72rem; font-weight: 750; cursor: pointer; }
.avatar-option:hover { background: rgba(255,255,255,.09); }
.avatar-option--selected { border-color: #fff; background: rgba(255,255,255,.12); color: #fff; }
.avatar-option i { position: absolute; top: .38rem; right: .38rem; width: 15px; height: 15px; border-radius: 50%; background: #fff; opacity: 0; }
.avatar-option--selected i { opacity: 1; }
.avatar-option--selected i::after { content: ''; position: absolute; left: 4px; top: 2px; width: 5px; height: 8px; border: solid #111; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.profile-form-actions { margin-top: .25rem; justify-content: flex-start; flex-wrap: wrap; }
.profile-delete-link { justify-self: start; padding: .35rem 0; border: 0; background: transparent; color: #fca5a5; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.profile-dialog-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1.25rem; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.profile-dialog { width: min(100%, 400px); padding: 1.6rem; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: #18181b; box-shadow: 0 24px 70px rgba(0,0,0,.6); text-align: center; }
.profile-dialog__avatar { display: flex; justify-content: center; margin-bottom: .9rem; }
.profile-dialog h2 { margin: 0; font-size: 1.45rem; }
.profile-dialog p { margin: .65rem 0 1.4rem; color: #b9b9b9; font-size: .9rem; line-height: 1.5; }
.profile-dialog__actions { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.button--danger { background: #b91c1c; color: #fff; }
.button--danger:hover { background: #dc2626; }
@media (max-width: 520px) { .profiles-grid { gap: 1rem; } .profile-tile { width: calc(50% - .5rem); } .profile-tile--add { min-height: 164px; } .avatar-options { gap: .45rem; } }

/* Generated portrait avatar sprite. */
.profile-avatar-art img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* CSP-safe portrait sprite positioning and sizing. */
.profile-avatar-art--size-58 { width: 58px; height: 58px; }
.profile-avatar-art--size-62 { width: 62px; height: 62px; }
.profile-avatar-art--size-74 { width: 74px; height: 74px; }
.profile-avatar-art--size-112 { width: 112px; height: 112px; }
