:root {
    --bg: #f5f7fb;
    --surface: #fff;
    --surface2: #eef2ff;
    --text: #161a2b;
    --muted: #697087;
    --line: #e3e7f1;
    --brand: #3028ff;
    --brand2: #55baf6;
    --shadow: 0 18px 45px rgba(40, 45, 95, .10);
    --danger: #c9384d;
    --success: #168b5b;
    --sidebar: #11162f;
    --input: #fff
}

html[data-theme="dark"] {
    --bg: #0c1020;
    --surface: #151a2f;
    --surface2: #1c2340;
    --text: #f4f6ff;
    --muted: #9aa4c3;
    --line: #28304f;
    --shadow: 0 20px 55px rgba(0, 0, 0, .32);
    --sidebar: #090d1d;
    --input: #101629
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text)
}

a {
    color: var(--brand);
    text-decoration: none
}

button,
input,
select,
textarea {
    font: inherit
}

.app-shell {
    display: grid;
    grid-template-columns: 255px 1fr;
    min-height: 100vh
}

.sidebar {
    background: var(--sidebar);
    color: #fff;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column
}

.brand-wrap {
    padding: 2px 7px 24px
}

.brand-logo {
    width: 142px;
    border-radius: 14px;
    display: block
}

.brand-sub {
    font-size: 12px;
    letter-spacing: .17em;
    text-transform: uppercase;
    color: #aeb8ee;
    margin: 8px 2px 0
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: auto
}

.nav-link {
    color: #dbe1ff;
    padding: 10px 12px;
    border-radius: 11px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px
}

.nav-link:hover {
    background: #20284d;
    color: #fff
}

.nav-link span {
    flex: 1
}

.nav-heading {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #7983b7;
    padding: 20px 12px 7px
}

.badge-count {
    background: #fff;
    color: #2525db;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: grid;
    place-items: center;
    font-size: 11px
}

.sidebar-user {
    margin-top: auto;
    border-top: 1px solid #273057;
    padding: 16px 8px 0;
    display: flex;
    align-items: center;
    gap: 10px
}

.sidebar-user strong,
.sidebar-user small {
    display: block
}

.sidebar-user small {
    color: #8e99c8;
    margin-top: 2px
}

.sidebar-user>a {
    margin-left: auto;
    color: #cfd5ff
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #63d5ff, #3028ff);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800
}

.avatar.small {
    width: 32px;
    height: 32px;
    font-size: 11px
}

.main {
    min-width: 0
}

.topbar {
    height: 104px;
    padding: 22px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 20
}

.topbar h1 {
    font-size: 24px;
    margin: 0 0 4px
}

.topbar p {
    margin: 0;
    color: var(--muted);
    font-size: 14px
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    display: grid;
    place-items: center;
    position: relative
}

.icon-button span {
    position: absolute;
    right: -4px;
    top: -4px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    border-radius: 999px;
    padding: 2px 5px
}

.content {
    padding: 30px 34px 60px;
    max-width: 1500px;
    margin: 0 auto
}

.hero-card {
    background: linear-gradient(120deg, #171e68, #3028ff 58%, #59c8f5);
    color: #fff;
    border-radius: 24px;
    padding: 32px 34px;
    min-height: 220px;
    display: flex;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative
}

.hero-card h2 {
    font-size: 34px;
    margin: 10px 0
}

.hero-card p {
    max-width: 610px;
    color: #dce1ff
}

.hero-g {
    width: 220px;
    opacity: .23;
    transform: rotate(8deg);
    margin: -20px 25px -70px 10px
}

.eyebrow {
    font-size: 11px;
    letter-spacing: .15em;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--muted)
}

.hero-card .eyebrow {
    color: #b8c5ff
}

.rarity-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px
}

.rarity {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 900;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--surface2);
    color: var(--text);
    display: inline-flex
}

.rarity.common {
    background: #e8ecf3;
    color: #495469
}

.rarity.uncommon {
    background: #e2f8ed;
    color: #16704c
}

.rarity.rare {
    background: #e5f2ff;
    color: #1e63a8
}

.rarity.epic {
    background: #f0e7ff;
    color: #7540c9
}

.rarity.legendary {
    background: linear-gradient(90deg, #fff0b5, #ffd65a);
    color: #72510a
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin: 30px 0 14px
}

.section-head h2 {
    margin: 0;
    font-size: 18px
}

.section-head a {
    font-size: 13px;
    font-weight: 700
}

.section-head.tight {
    margin: 0 0 14px
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px
}

.achievement-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    gap: 14px;
    color: var(--text);
    box-shadow: 0 7px 22px rgba(30, 40, 80, .05)
}

.achievement-card:hover {
    transform: translateY(-2px);
    transition: .18s;
    box-shadow: var(--shadow)
}

.badge-art {
    width: 64px;
    height: 64px;
    border-radius: 17px;
    background: var(--surface2);
    display: grid;
    place-items: center;
    flex: none;
    box-shadow: inset 0 0 0 1px rgba(48, 40, 255, .08)
}

.badge-art img {
    width: 50px;
    height: 50px;
    object-fit: contain
}

.badge-art.large {
    width: 80px;
    height: 80px;
    border-radius: 22px
}

.badge-art.large img {
    width: 66px;
    height: 66px
}

.badge-art.xl {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    background: #fff
}

.badge-art.xl img {
    width: 90px;
    height: 90px
}

.achievement-card h3 {
    margin: 7px 0 4px;
    font-size: 15px
}

.achievement-card small,
.feed-row small,
.muted,
small {
    color: var(--muted)
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px
}

.progress-card,
.panel,
.feed-card,
.table-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 7px 22px rgba(30, 40, 80, .04)
}

.progress-card {
    padding: 18px;
    color: var(--text)
}

.progress-card h3 {
    margin: 6px 0 12px
}

.progress {
    height: 7px;
    border-radius: 999px;
    background: var(--surface2);
    overflow: hidden;
    margin: 9px 0
}

.progress span {
    height: 100%;
    display: block;
    background: linear-gradient(90deg, var(--brand), var(--brand2));
    border-radius: inherit
}

.feed-card {
    padding: 4px 18px
}

.feed-card.wide {
    max-width: 1050px
}

.feed-row {
    padding: 15px 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line)
}

.feed-row:last-child {
    border-bottom: 0
}

.feed-row small {
    display: block;
    margin-top: 4px
}

.feed-row .grow {
    flex: 1
}

.feed-row blockquote {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--brand);
    background: var(--surface2);
    border-radius: 0 10px 10px 0;
    color: var(--muted)
}

.mini-badge {
    width: 44px;
    height: 44px
}

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: 18px;
    padding: 28px;
    color: var(--muted);
    grid-column: 1/-1;
    text-align: center
}

.filterbar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px
}

.filterbar input {
    flex: 1
}

.catalog {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px
}

.catalog-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    color: var(--text);
    box-shadow: 0 8px 25px rgba(30, 40, 80, .04)
}

.catalog-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    transition: .18s
}

.catalog-card.locked .badge-art {
    filter: saturate(.2);
    opacity: .68
}

.catalog-banner {
    height: 142px;
    background: linear-gradient(125deg, #27329b, #3028ff, #6ad8ff);
    background-size: cover;
    background-position: center;
    padding: 18px;
    display: flex;
    align-items: end;
    position: relative
}

.lock-pill,
.unlocked-pill {
    position: absolute;
    right: 14px;
    top: 14px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(10, 14, 46, .74);
    color: #fff;
    padding: 6px 9px;
    border-radius: 999px;
    backdrop-filter: blur(8px)
}

.unlocked-pill {
    background: rgba(20, 125, 78, .85)
}

.catalog-body {
    padding: 17px
}

.meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px
}

.catalog-body h3 {
    margin: 11px 0 7px
}

.catalog-body p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
    min-height: 55px
}

.detail-hero {
    min-height: 235px;
    border-radius: 24px;
    background: linear-gradient(110deg, #171e68, #3028ff);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 34px;
    display: flex;
    gap: 25px;
    align-items: center;
    box-shadow: var(--shadow)
}

.detail-hero h2 {
    font-size: 34px;
    margin: 10px 0 8px
}

.detail-hero p {
    max-width: 720px;
    color: #e0e5ff
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 18px;
    margin-top: 18px
}

.panel {
    padding: 22px
}

.panel h3 {
    margin-top: 0
}

.detail-list {
    margin: 0
}

.detail-list>div {
    display: grid;
    grid-template-columns: 120px 1fr;
    padding: 12px 0;
    border-bottom: 1px solid var(--line)
}

.detail-list>div:last-child {
    border-bottom: 0
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700
}

.detail-list dd {
    margin: 0
}

.leader-note {
    background: var(--surface2);
    border-radius: 14px;
    padding: 15px;
    margin-top: 14px
}

.leader-note span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    font-weight: 900
}

.leader-note p {
    margin: 7px 0 0
}

.success-block>strong {
    color: var(--success)
}

.notice {
    padding: 12px;
    background: var(--surface2);
    border-radius: 11px;
    margin-top: 16px;
    color: var(--muted)
}

.notification-list {
    max-width: 900px
}

.notification-item {
    display: flex;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 10px
}

.notification-item h3 {
    margin: 0 0 6px
}

.notification-item p {
    margin: 0 0 6px;
    color: var(--muted)
}

.notify-icon {
    width: 42px;
    height: 42px;
    background: var(--surface2);
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: var(--brand)
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 750;
    color: var(--muted)
}

input,
select,
textarea {
    background: var(--input);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 11px 12px;
    outline: none;
    width: 100%
}

textarea {
    resize: vertical
}

input:focus,
select:focus,
textarea:focus {
    border-color: #817dff;
    box-shadow: 0 0 0 3px rgba(48, 40, 255, .11)
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 14px
}

legend {
    padding: 0 6px;
    font-size: 12px;
    font-weight: 800
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px
}

.check {
    flex-direction: row;
    align-items: center;
    font-weight: 600
}

.check input {
    width: auto
}

.btn {
    border: 0;
    border-radius: 11px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px
}

.btn.primary {
    background: linear-gradient(135deg, #3028ff, #534cff);
    color: #fff
}

.btn.secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--line)
}

.btn.danger {
    background: #ffe7eb;
    color: #a9253a
}

.btn.ghost {
    background: transparent
}

.btn.tiny {
    padding: 6px 9px;
    font-size: 11px
}

.btn.big {
    padding: 14px 18px
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px
}

.table-card {
    overflow: auto
}

.table-card table {
    width: 100%;
    border-collapse: collapse
}

.table-card th,
.table-card td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    vertical-align: middle
}

.table-card th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .11em;
    color: var(--muted);
    background: var(--surface2)
}

.table-ach {
    display: flex;
    gap: 10px;
    align-items: center
}

.table-ach img {
    width: 40px;
    height: 40px
}

.table-ach small {
    display: block;
    margin-top: 3px
}

.actions {
    display: flex;
    gap: 10px
}

.link-button {
    border: 0;
    background: none;
    color: var(--brand);
    padding: 0;
    cursor: pointer
}

.pill {
    font-size: 10px;
    background: var(--surface2);
    border-radius: 999px;
    padding: 4px 7px;
    margin-left: 6px
}

.pill.pending {
    background: #fff2cd;
    color: #84610a
}

.pill.approved {
    background: #dff6e9;
    color: #146744
}

.pill.rejected {
    background: #f4e6e9;
    color: #8d3341
}

.copy-row {
    display: flex;
    gap: 8px;
    margin-top: 10px
}

.permission-list>div {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line)
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.studio-layout {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 18px
}

.media-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 220px;
    overflow: auto
}

.media-thumb {
    border: 1px solid var(--line);
    background: var(--surface2);
    padding: 8px;
    border-radius: 12px;
    text-align: center
}

.media-thumb img {
    width: 52px;
    height: 52px
}

.media-thumb small {
    display: block;
    font-size: 9px
}

.banner-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px
}

.banner-strip img {
    width: 100%;
    aspect-ratio: 3/1;
    object-fit: cover;
    border-radius: 10px
}

.progress-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 16px
}

.progress-editor h3 {
    margin: 6px 0
}

.progress-editor p {
    color: var(--muted);
    font-size: 13px
}

.panel.compact {
    max-width: 500px
}

.spec-card {
    background: var(--surface2);
    border-radius: 13px;
    padding: 14px
}

.spec-card p {
    margin: 7px 0;
    color: var(--muted);
    font-size: 12px
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px
}

.asset-card {
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.asset-preview {
    width: 100%;
    height: 90px;
    object-fit: contain;
    background: var(--surface2);
    border-radius: 8px
}

.asset-preview.banner {
    object-fit: cover
}

.sound-tile {
    height: 68px;
    background: linear-gradient(135deg, #3028ff, #62c9ff);
    border-radius: 9px;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 28px
}

.asset-card audio {
    width: 100%;
    height: 28px
}

.simple-list>div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line)
}

.inline-create {
    display: flex;
    gap: 8px;
    margin-top: 14px
}

.profile-cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.profile-cards>div {
    min-width: 180px;
    background: var(--surface2);
    padding: 14px;
    border-radius: 12px
}

.profile-cards small {
    display: block;
    margin-top: 4px
}

.alert {
    padding: 14px 16px;
    border-radius: 13px;
    margin-bottom: 16px
}

.alert.success {
    background: #e3f8ed;
    color: #146e4a
}

.alert.danger {
    background: #ffe7eb;
    color: #a7293e
}

.inline-form {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-top: 8px
}

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 18% 20%, #6579ff 0, transparent 28%), radial-gradient(circle at 82% 10%, #6ad8ff 0, transparent 24%), linear-gradient(135deg, #10174e, #251bbb 55%, #0c75ac);
    padding: 28px
}

.auth-card {
    width: min(430px, 100%);
    background: #fff;
    color: #161a2b;
    border-radius: 26px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(5, 8, 45, .35);
    position: relative;
    overflow: hidden
}

.auth-card label {
    color: #555f76
}

.auth-card input {
    background: #fff;
    color: #161a2b
}

.auth-logo {
    width: 142px;
    border-radius: 13px
}

.auth-mark {
    position: absolute;
    right: -45px;
    top: -25px;
    width: 180px;
    height: 180px;
    opacity: .08
}

.auth-mark img {
    width: 100%
}

.auth-card h1 {
    margin: 27px 0 7px
}

.auth-card>p {
    color: #697087;
    margin-top: 0
}

.celebration-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 28, .82);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    animation: fadeIn .3s
}

.celebration-card {
    width: min(580px, 100%);
    background: linear-gradient(155deg, #fff, #f1f2ff);
    color: #14182b;
    border-radius: 30px;
    padding: 36px;
    text-align: center;
    box-shadow: 0 45px 100px rgba(0, 0, 0, .42);
    position: relative;
    overflow: hidden
}

.celebration-card:before {
    content: "";
    position: absolute;
    inset: -80px;
    background: conic-gradient(from 0deg, transparent, #c8ccff33, transparent, #6ed8ff44, transparent);
    animation: spin 12s linear infinite
}

.celebration-card>* {
    position: relative
}

.celebration-badge {
    width: 130px;
    height: 130px;
    margin: 18px auto 5px;
    filter: drop-shadow(0 14px 20px rgba(44, 38, 255, .28))
}

.celebration-card h2 {
    font-size: 36px;
    margin: 8px 0
}

.celebration-copy {
    font-size: 17px;
    line-height: 1.55;
    color: #555f76
}

.sparkles {
    font-size: 26px;
    color: #e3aa17;
    letter-spacing: .3em
}

.celebration-card .leader-note {
    text-align: left;
    background: #eef0ff
}

.celebration-card .eyebrow {
    color: #72510a
}

.celebration-card .btn {
    margin-top: 18px
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@media(max-width:1050px) {

    .achievement-grid,
    .catalog {
        grid-template-columns: repeat(2, 1fr)
    }

    .detail-grid,
    .studio-layout {
        grid-template-columns: 1fr
    }

    .progress-list {
        grid-template-columns: 1fr
    }
}

@media(max-width:760px) {
    .app-shell {
        grid-template-columns: 1fr
    }

    .sidebar {
        position: static;
        height: auto
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr)
    }

    .sidebar-user {
        display: none
    }

    .main {
        min-width: 0
    }

    .topbar {
        position: static;
        height: auto;
        padding: 18px 20px
    }

    .content {
        padding: 20px
    }

    .achievement-grid,
    .catalog,
    .panel-grid {
        grid-template-columns: 1fr
    }

    .hero-g {
        display: none
    }

    .hero-card h2 {
        font-size: 27px
    }

    .filterbar {
        flex-direction: column
    }

    .two-col,
    .check-grid {
        grid-template-columns: 1fr
    }

    .detail-hero {
        flex-direction: column;
        align-items: flex-start
    }

    .detail-hero h2 {
        font-size: 27px
    }

    .asset-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

/* v1.1 navigation and permissions */
.topbar-heading-wrap {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0
}

.in-app-back {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(25, 35, 75, .05)
}

.in-app-back:hover {
    transform: translateX(-2px);
    border-color: #8581ff;
    color: var(--brand)
}

.alert.info {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--line)
}

.toolbar-split {
    justify-content: space-between
}

.criteria-cell {
    min-width: 320px;
    max-width: 560px;
    white-space: normal;
    line-height: 1.45
}

.criteria-cell strong,
.criteria-cell span,
.criteria-cell small {
    display: block
}

.criteria-cell span {
    margin-top: 5px;
    color: var(--muted)
}

.criteria-cell small {
    margin-top: 6px;
    color: var(--brand);
    font-weight: 750
}

.achievement-studio-table {
    min-width: 1240px
}

.table-sub {
    display: block;
    margin-top: 4px;
    color: var(--muted)
}

.permissions-page {
    gap: 18px
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px
}

.section-heading h3 {
    margin-bottom: 4px
}

.section-heading p {
    margin: 0
}

.permission-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px
}

.permission-profile-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface2);
    padding: 16px
}

.permission-profile-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px
}

.permission-profile-title small {
    display: block;
    color: var(--muted);
    margin-top: 4px
}

.permission-matrix {
    display: flex;
    flex-direction: column;
    gap: 7px
}

.permission-toggle {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-weight: 600
}

.permission-toggle:last-child {
    border-bottom: 0
}

.permission-toggle input {
    width: auto;
    margin-top: 3px
}

.permission-toggle b {
    display: block;
    font-size: 12px
}

.permission-toggle small {
    display: block;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.35;
    margin-top: 2px
}

.compact-permissions {
    max-height: 520px;
    overflow: auto;
    padding-right: 4px
}

.table-card.embedded {
    border: 1px solid var(--line);
    border-radius: 13px
}

.permission-list>div>span b {
    display: block;
    color: var(--text);
    font-size: 12px
}

.permission-list>div>span small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.3;
    margin-top: 2px
}

@media(max-width:1180px) {
    .permission-profile-grid {
        grid-template-columns: 1fr
    }

    .compact-permissions {
        max-height: none
    }
}

@media(max-width:760px) {
    .topbar-heading-wrap {
        align-items: flex-start
    }

    .in-app-back {
        width: 34px;
        height: 34px;
        flex-basis: 34px
    }

    .toolbar-split,
    .section-heading {
        flex-direction: column
    }

    .criteria-cell {
        min-width: 260px
    }
}

/* v1.2 polish */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important
}

/* Sidebar branding: integrated wordmark, no floating logo tile */
.brand-wrap {
    padding: 4px 10px 20px;
    margin: 0 0 10px;
    border-bottom: 1px solid rgba(207, 213, 255, .13)
}

.brand-logo {
    width: 188px;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    display: block;
    object-fit: contain
}

.brand-sub {
    font-size: 11px;
    letter-spacing: .19em;
    text-transform: uppercase;
    color: #9eaae2;
    margin: 6px 1px 0
}

/* Password setup guidance */
.password-requirements {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 14px 0 18px;
    padding: 12px 14px;
    border: 1px solid #e1e5ef;
    border-radius: 12px;
    background: #f7f8ff;
    color: #30374d;
    font-size: 13px
}

.password-requirements span {
    color: #667087
}

/* Achievement Studio */
.studio-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px
}

.studio-summary-card {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 15px;
    padding: 15px 17px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(30, 39, 82, .035)
}

.studio-summary-card span {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: .035em
}

.studio-summary-card strong {
    font-size: 24px;
    line-height: 1;
    color: var(--text)
}

.studio-controlbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 15px
}

.studio-filters {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0
}

.studio-filters label {
    min-width: 150px
}

.studio-filters .studio-search {
    flex: 1;
    max-width: 520px;
    min-width: 260px
}

.studio-filters input,
.studio-filters select {
    height: 42px;
    background: var(--surface2);
    border-color: transparent
}

.studio-filters input:focus,
.studio-filters select:focus {
    background: var(--input);
    border-color: #817dff
}

.studio-new {
    white-space: nowrap;
    height: 42px
}

.studio-table-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(28, 36, 78, .04)
}

.achievement-studio-table {
    min-width: 1160px
}

.achievement-studio-table th {
    padding-top: 13px;
    padding-bottom: 13px;
    background: color-mix(in srgb, var(--surface2) 76%, var(--surface));
    border-bottom: 1px solid var(--line)
}

.achievement-studio-table tbody tr {
    transition: background .16s ease, transform .16s ease
}

.achievement-studio-table tbody tr:hover {
    background: color-mix(in srgb, var(--surface2) 46%, transparent)
}

.achievement-studio-table td {
    padding-top: 15px;
    padding-bottom: 15px;
    vertical-align: top
}

.achievement-studio-table th:first-child,
.achievement-studio-table td:first-child {
    padding-left: 18px
}

.achievement-studio-table th:last-child,
.achievement-studio-table td:last-child {
    padding-right: 18px
}

.studio-achievement-cell {
    min-width: 185px;
    align-items: flex-start
}

.studio-icon-shell {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8f9ff;
    display: grid;
    place-items: center;
    box-shadow: 0 5px 12px rgba(43, 44, 120, .06)
}

.studio-icon-shell img {
    width: 34px;
    height: 34px;
    object-fit: contain
}

.studio-achievement-cell strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
    color: var(--text)
}

.studio-achievement-cell small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px
}

.criteria-cell {
    min-width: 330px;
    max-width: 500px;
    white-space: normal;
    line-height: 1.42
}

.criteria-cell>strong {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.4
}

.criteria-cell>span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.45
}

.criteria-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px
}

.criteria-cell .criteria-meta small {
    margin: 0;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--surface2);
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: uppercase
}

.rarity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap
}

.rarity.common {
    background: #edf1f7;
    color: #4e5b70
}

.rarity.uncommon {
    background: #e4f8ed;
    color: #16714a
}

.rarity.rare {
    background: #e7f2ff;
    color: #1462a4
}

.rarity.epic {
    background: #efe8ff;
    color: #6841a9
}

.rarity.legendary {
    background: #fff1bd;
    color: #805a00;
    border-color: #f4d777
}

.studio-tracks-cell {
    min-width: 230px;
    max-width: 300px
}

.track-chip {
    display: inline-flex;
    align-items: center;
    margin: 0 4px 4px 0;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 9.5px;
    font-weight: 750;
    line-height: 1.15
}

.track-chip.shared {
    background: color-mix(in srgb, var(--brand) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
    color: var(--brand)
}

.track-chip.more {
    color: var(--muted);
    font-weight: 700
}

.cadence-text {
    display: block;
    min-width: 84px;
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--text)
}

.studio-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap
}

.studio-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    background: #26a66d;
    box-shadow: 0 0 0 3px rgba(38, 166, 109, .11)
}

.studio-status.archived {
    color: var(--muted)
}

.studio-status.archived i {
    background: #98a0b8;
    box-shadow: none
}

.actions-heading {
    text-align: right !important
}

.studio-actions {
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
    white-space: nowrap
}

.studio-actions form {
    margin: 0
}

.studio-action {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text) !important;
    border-radius: 9px;
    padding: 6px 9px;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.studio-action:hover {
    border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
    background: var(--surface2);
    color: var(--brand) !important
}

.studio-action-muted {
    color: var(--muted) !important
}

.studio-empty {
    padding: 34px;
    text-align: center;
    color: var(--muted);
    font-size: 13px
}

html[data-theme="dark"] .studio-icon-shell {
    background: #f7f8ff
}

html[data-theme="dark"] .studio-action,
html[data-theme="dark"] .studio-action-muted {
    color: #fff !important;
    background: #171d34;
    border-color: #323a5b
}

html[data-theme="dark"] .studio-action:hover,
html[data-theme="dark"] .studio-action-muted:hover {
    background: #222a49;
    border-color: #5f68a4;
    color: #fff !important
}

html[data-theme="dark"] .rarity.common {
    background: #e9edf4;
    color: #46536a
}

html[data-theme="dark"] .rarity.uncommon {
    background: #dff7e9;
    color: #12663f
}

html[data-theme="dark"] .rarity.rare {
    background: #e1efff;
    color: #135b97
}

html[data-theme="dark"] .rarity.epic {
    background: #eee5ff;
    color: #5e349f
}

html[data-theme="dark"] .rarity.legendary {
    background: #ffe89a;
    color: #6e4d00
}

/* Access & Permissions */
.permission-intro {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px
}

.permission-intro p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5
}

.permission-intro-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--brand) 10%, var(--surface));
    display: grid;
    place-items: center;
    color: var(--brand);
    font-weight: 900
}

.access-profile-panel {
    padding: 20px
}

.access-heading {
    margin-bottom: 14px
}

.profile-count-pill,
.scope-badge,
.user-count {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 9.5px;
    font-weight: 850;
    letter-spacing: .035em;
    white-space: nowrap
}

.profile-count-pill {
    background: var(--surface2);
    color: var(--muted);
    border: 1px solid var(--line)
}

.scope-badge {
    background: color-mix(in srgb, var(--brand) 9%, var(--surface));
    color: var(--brand);
    border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line))
}

.user-count {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line)
}

.access-profile-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.access-profile {
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    overflow: hidden
}

.access-profile[open] {
    box-shadow: 0 12px 28px rgba(28, 36, 78, .045);
    border-color: color-mix(in srgb, var(--brand) 18%, var(--line))
}

.access-profile summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    user-select: none
}

.access-profile summary::-webkit-details-marker {
    display: none
}

.access-profile summary:hover {
    background: color-mix(in srgb, var(--surface2) 42%, transparent)
}

.access-profile-summary-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0
}

.access-profile-summary-main strong {
    display: block;
    color: var(--text);
    font-size: 14px
}

.access-profile-summary-main small {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    margin-top: 3px;
    line-height: 1.35
}

.access-profile-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 900;
    background: #eef0ff;
    color: #332cff
}

.access-profile-icon.supervisor {
    background: #e7f2ff;
    color: #1c66a7
}

.access-profile-icon.employee {
    background: #e8f7ef;
    color: #18704c
}

.access-profile-icon.admin {
    background: #efe8ff;
    color: #6841a9
}

.access-profile-summary-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap
}

.chevron {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--surface2);
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 15px;
    transition: transform .2s ease
}

.access-profile[open] .chevron {
    transform: rotate(180deg)
}

.access-profile-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--line)
}

.permission-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 14px
}

.permission-group {
    border: 1px solid var(--line);
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface2) 44%, var(--surface));
    padding: 13px
}

.permission-group-heading h4 {
    margin: 0;
    font-size: 12px;
    color: var(--text)
}

.permission-group-heading p {
    margin: 3px 0 10px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.35
}

.permission-group-list {
    display: flex;
    flex-direction: column
}

.permission-switch-row {
    display: grid;
    grid-template-columns: 1fr 0 38px;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    color: var(--text);
    cursor: pointer
}

.permission-switch-row:first-child {
    border-top: 0
}

.permission-switch-row b {
    display: block;
    font-size: 11.5px;
    color: var(--text)
}

.permission-switch-row small {
    display: block;
    margin-top: 2px;
    font-size: 9.5px;
    line-height: 1.32;
    color: var(--muted);
    font-weight: 500
}

.permission-switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0
}

.switch {
    width: 36px;
    height: 21px;
    border-radius: 999px;
    background: #cbd1df;
    position: relative;
    transition: .18s ease;
    border: 1px solid rgba(0, 0, 0, .04)
}

.switch:after {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
    transition: .18s ease
}

.permission-switch-row input:checked+.switch {
    background: linear-gradient(135deg, #3028ff, #544dff)
}

.permission-switch-row input:checked+.switch:after {
    transform: translateX(15px)
}

.access-profile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 14px
}

.access-profile-footer p {
    margin: 0;
    font-size: 10.5px
}

.owner-safety-note {
    margin: 14px 2px 0;
    color: var(--muted);
    font-size: 10.5px
}

.individual-access-panel {
    margin-top: 2px
}

.profile-name-chip {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--line);
    font-size: 10px;
    font-weight: 800
}

.adjust-link {
    font-weight: 800;
    font-size: 11px;
    white-space: nowrap
}

.adjust-link span {
    display: inline-block;
    margin-left: 3px;
    transition: transform .15s
}

.adjust-link:hover span {
    transform: translateX(2px)
}

html[data-theme="dark"] .access-profile-icon.admin,
html[data-theme="dark"] .access-profile-icon.supervisor,
html[data-theme="dark"] .access-profile-icon.employee {
    background: #f1f3ff
}

html[data-theme="dark"] .switch {
    background: #424b69
}

/* Media Library */
.media-library-layout {
    display: grid;
    grid-template-columns: minmax(320px, .8fr) minmax(460px, 1.2fr);
    gap: 16px;
    margin-bottom: 16px
}

.media-upload-panel,
.banner-presets-panel,
.media-assets-panel {
    padding: 20px
}

.media-specs {
    padding: 14px
}

.media-spec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px
}

.media-spec-grid p {
    margin: 0;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px
}

.media-spec-grid b {
    color: var(--text);
    font-size: 11px
}

.media-spec-grid span {
    color: var(--text);
    font-weight: 800;
    font-size: 12px
}

.media-spec-grid small {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.25
}

.preset-banner-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px
}

.preset-banner-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface)
}

.preset-banner-card img {
    display: block;
    width: 100%;
    aspect-ratio: 3/1;
    object-fit: cover
}

.preset-banner-card div {
    padding: 9px 10px
}

.preset-banner-card strong,
.preset-banner-card small {
    display: block
}

.preset-banner-card strong {
    font-size: 11px
}

.preset-banner-card small {
    font-size: 9px;
    color: var(--muted);
    margin-top: 2px
}

.media-assets-panel {
    margin-bottom: 18px
}

.media-assets-panel .section-heading {
    margin-bottom: 14px
}

.polished-assets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px
}

.polished-assets .asset-card {
    padding: 11px;
    border-radius: 14px;
    background: var(--surface)
}

.asset-card-copy strong,
.asset-card-copy small {
    display: block
}

.asset-card-copy strong {
    font-size: 11px
}

.asset-card-copy small {
    font-size: 9px;
    color: var(--muted);
    margin-top: 2px
}

@media(max-width:1200px) {
    .studio-summary-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .permission-groups-grid {
        grid-template-columns: 1fr
    }

    .media-library-layout {
        grid-template-columns: 1fr
    }

    .polished-assets {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media(max-width:820px) {
    .studio-controlbar {
        align-items: stretch;
        flex-direction: column
    }

    .studio-filters {
        align-items: stretch;
        flex-direction: column
    }

    .studio-filters label,
    .studio-filters .studio-search {
        max-width: none;
        min-width: 0
    }

    .studio-new {
        width: 100%
    }

    .access-profile summary {
        align-items: flex-start;
        flex-direction: column
    }

    .access-profile-summary-meta {
        justify-content: flex-start
    }

    .access-profile-footer {
        align-items: stretch;
        flex-direction: column
    }

    .preset-banner-grid {
        grid-template-columns: 1fr
    }

    .polished-assets {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:560px) {
    .studio-summary-grid {
        grid-template-columns: 1fr
    }

    .media-spec-grid {
        grid-template-columns: 1fr
    }

    .polished-assets {
        grid-template-columns: 1fr
    }

    .brand-logo {
        width: 160px
    }
}

/* Achievement Studio v1.2.1 — list-based management layout */
.studio-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px
}

.studio-summary-card {
    min-height: 88px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 17px;
    padding: 17px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(30, 39, 82, .035)
}

.studio-summary-card>div {
    min-width: 0
}

.studio-summary-card span {
    display: block;
    font-size: 12px;
    font-weight: 850;
    color: var(--text);
    letter-spacing: .01em
}

.studio-summary-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10.5px
}

.studio-summary-card strong {
    font-size: 27px;
    line-height: 1;
    color: var(--text)
}

.studio-toolbar-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(30, 39, 82, .03)
}

.studio-toolbar-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px
}

.studio-toolbar-top>div>strong {
    display: block;
    font-size: 14px;
    color: var(--text)
}

.studio-toolbar-top p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11.5px
}

.studio-new {
    white-space: nowrap
}

.studio-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 180px;
    gap: 10px;
    align-items: end
}

.studio-filters label {
    min-width: 0;
    gap: 5px
}

.studio-filters label>span {
    font-size: 9.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 850;
    color: var(--muted)
}

.studio-filters input,
.studio-filters select {
    height: 41px;
    background: var(--surface2);
    border-color: transparent
}

.studio-filters input:focus,
.studio-filters select:focus {
    background: var(--input);
    border-color: #817dff
}

.studio-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.studio-item {
    display: grid;
    grid-template-columns: minmax(205px, .8fr) minmax(360px, 1.55fr) minmax(255px, 1fr) auto;
    gap: 18px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 15px 15px 15px 17px;
    box-shadow: 0 7px 22px rgba(30, 40, 80, .035);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease
}

.studio-item:hover {
    border-color: color-mix(in srgb, var(--brand) 22%, var(--line));
    box-shadow: 0 12px 30px rgba(30, 40, 80, .07);
    transform: translateY(-1px)
}

.studio-item-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0
}

.studio-icon-shell {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8f9ff;
    display: grid;
    place-items: center;
    box-shadow: 0 5px 12px rgba(43, 44, 120, .06)
}

.studio-icon-shell img {
    width: 36px;
    height: 36px;
    object-fit: contain
}

.studio-title-copy {
    min-width: 0
}

.studio-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.studio-title-line h3 {
    font-size: 13px;
    line-height: 1.3;
    margin: 0;
    color: var(--text)
}

.studio-title-copy>p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10.5px
}

.studio-item-criteria {
    min-width: 0;
    padding-left: 18px;
    border-left: 1px solid var(--line)
}

.studio-kicker {
    display: block;
    margin-bottom: 5px;
    font-size: 8.5px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-weight: 900;
    color: var(--muted)
}

.studio-item-criteria>strong {
    display: block;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text)
}

.studio-item-criteria>p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45
}

.criteria-meta {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 7px
}

.criteria-meta small {
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--surface2);
    color: var(--muted);
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em
}

.studio-item-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding-left: 18px;
    border-left: 1px solid var(--line)
}

.studio-track-list {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap
}

.track-chip {
    margin: 0;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 9px;
    font-weight: 750;
    line-height: 1.15
}

.track-chip.shared {
    background: color-mix(in srgb, var(--brand) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
    color: var(--brand)
}

.track-chip.more {
    color: var(--muted)
}

.studio-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.studio-detail-value {
    display: block;
    font-size: 10.5px;
    line-height: 1.3;
    color: var(--text)
}

.studio-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap
}

.studio-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    background: #26a66d;
    box-shadow: 0 0 0 3px rgba(38, 166, 109, .11)
}

.studio-status.archived {
    color: var(--muted)
}

.studio-status.archived i {
    background: #98a0b8;
    box-shadow: none
}

.studio-item-actions {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding-left: 4px
}

.studio-item-actions form {
    margin: 0
}

.studio-action {
    width: 78px;
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text) !important;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 10.5px;
    font-weight: 850;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .15s ease
}

.studio-action-primary {
    background: color-mix(in srgb, var(--brand) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
    color: var(--brand) !important
}

.studio-action:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    background: var(--surface2)
}

.studio-action-muted {
    color: var(--muted) !important
}

.studio-empty {
    margin-top: 10px;
    text-align: center;
    color: var(--muted);
    font-size: 12px
}

html[data-theme="dark"] .studio-icon-shell {
    background: #f7f8ff
}

html[data-theme="dark"] .studio-action,
html[data-theme="dark"] .studio-action-muted {
    color: #fff !important;
    background: #171d34;
    border-color: #323a5b
}

html[data-theme="dark"] .studio-action-primary {
    color: #fff !important;
    background: #3028ff;
    border-color: #514aff
}

html[data-theme="dark"] .studio-action:hover {
    background: #222a49;
    border-color: #5f68a4;
    color: #fff !important
}

@media(max-width:1250px) {
    .studio-item {
        grid-template-columns: minmax(200px, .8fr) minmax(330px, 1.4fr) minmax(220px, .9fr) auto;
        gap: 14px
    }

    .studio-item-criteria,
    .studio-item-details {
        padding-left: 14px
    }
}

@media(max-width:1080px) {
    .studio-summary-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .studio-filters {
        grid-template-columns: 1fr 1fr
    }

    .studio-search {
        grid-column: 1/-1
    }

    .studio-item {
        grid-template-columns: 1fr auto;
        align-items: start
    }

    .studio-item-identity {
        grid-column: 1
    }

    .studio-item-actions {
        grid-column: 2;
        grid-row: 1;
        flex-direction: row;
        align-self: start
    }

    .studio-item-criteria {
        grid-column: 1/-1;
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 12px 0 0
    }

    .studio-item-details {
        grid-column: 1/-1;
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 12px 0 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px
    }
}

@media(max-width:700px) {
    .studio-summary-grid {
        grid-template-columns: 1fr 1fr
    }

    .studio-toolbar-top {
        flex-direction: column
    }

    .studio-new {
        width: 100%
    }

    .studio-filters {
        grid-template-columns: 1fr
    }

    .studio-search {
        grid-column: auto
    }

    .studio-item {
        grid-template-columns: 1fr
    }

    .studio-item-actions {
        grid-column: 1;
        grid-row: auto;
        flex-direction: row;
        justify-content: flex-start
    }

    .studio-item-details {
        grid-template-columns: 1fr
    }

    .studio-action {
        width: auto;
        min-width: 88px
    }

    .studio-summary-card {
        min-height: 78px;
        padding: 14px
    }

    .studio-summary-card strong {
        font-size: 23px
    }
}

/* v1.3 — celebration experience, sound controls, and visual media pickers */
.preference-block {
    border: 1px solid var(--line);
    background: var(--surface2);
    border-radius: 14px;
    padding: 14px 16px;
    display: grid;
    gap: 12px
}

.preference-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px
}

.preference-heading strong {
    display: block
}

.preference-heading small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.35
}

.preference-heading output {
    font-weight: 800;
    color: var(--brand);
    font-size: 13px;
    min-width: 42px;
    text-align: right
}

.volume-range {
    width: 100%;
    accent-color: var(--brand);
    cursor: pointer
}

.media-selection-panel {
    overflow: hidden
}

.media-selection-group {
    display: grid;
    gap: 9px
}

.media-selection-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px
}

.media-selection-heading strong {
    font-size: 13px
}

.media-selection-heading span {
    font-size: 10px;
    color: var(--muted)
}

.visual-picker {
    display: grid;
    gap: 9px;
    max-height: 248px;
    overflow: auto;
    padding: 2px 3px 4px
}

.icon-visual-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr))
}

.banner-visual-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 300px
}

.visual-choice {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface2);
    color: var(--text);
    border-radius: 13px;
    padding: 9px;
    cursor: pointer;
    position: relative;
    transition: border-color .16s, box-shadow .16s, transform .16s, background .16s;
    text-align: center;
    min-width: 0
}

.visual-choice:hover {
    border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
    transform: translateY(-1px)
}

.visual-choice.selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent);
    background: color-mix(in srgb, var(--brand) 7%, var(--surface))
}

.visual-choice.selected:after {
    content: "✓";
    position: absolute;
    right: 6px;
    top: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18)
}

.icon-choice {
    min-height: 96px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px
}

.icon-choice img {
    width: 52px;
    height: 52px;
    object-fit: contain
}

.icon-choice small,
.banner-choice small {
    font-size: 9px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%
}

.default-icon-preview {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3028ff, #67d1ff);
    color: #fff;
    font-size: 24px
}

.banner-choice {
    padding: 6px;
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 5px
}

.banner-choice img {
    width: 100%;
    height: 68px;
    object-fit: cover;
    border-radius: 9px
}

.no-banner-choice {
    border-style: dashed;
    min-height: 92px;
    color: var(--muted);
    font-weight: 800
}

.achievement-replay-row {
    margin-top: 14px
}

.celebration-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 24, .84);
    backdrop-filter: blur(14px);
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
    opacity: 0;
    transition: opacity .22s ease
}

.celebration-backdrop.active {
    opacity: 1
}

.celebration-backdrop.is-hidden {
    display: none
}

.celebration-backdrop.is-closing {
    opacity: 0
}

.celebration-stage {
    width: min(720px, 100%);
    max-height: min(860px, 94vh);
    overflow: auto;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 42px 110px rgba(0, 0, 0, .5);
    position: relative;
    transform: translateY(18px) scale(.97);
    opacity: 0;
    transition: transform .34s cubic-bezier(.2, .8, .2, 1), opacity .25s;
    isolation: isolate
}

.celebration-backdrop.active .celebration-stage {
    transform: translateY(0) scale(1);
    opacity: 1
}

.celebration-banner {
    height: 138px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 18px;
    overflow: visible;
    background-color: #18204a
}

.celebration-banner:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(4, 8, 34, .72));
    pointer-events: none
}

.celebration-banner-fallback {
    background-image: radial-gradient(circle at 30% 10%, rgba(104, 208, 255, .7), transparent 32%), linear-gradient(135deg, #2620bd, #111938 68%)
}

.celebration-rarity-line {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 10px;
    letter-spacing: .18em;
    white-space: nowrap;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .45)
}

.celebration-rarity-line span {
    height: 1px;
    width: 34px;
    background: rgba(255, 255, 255, .6)
}

.celebration-badge-wrap {
    position: relative;
    z-index: 6;
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    transform: translateY(42px)
}

.celebration-badge {
    width: 96px;
    height: 96px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .28))
}

.celebration-ring {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .55);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, .08), 0 0 34px rgba(91, 121, 255, .35)
}

.celebration-body {
    padding: 58px 34px 30px;
    text-align: center;
    position: relative;
    z-index: 3
}

.celebration-kicker {
    font-size: 10px;
    letter-spacing: .18em;
    font-weight: 900;
    color: var(--brand);
    margin-bottom: 9px
}

.celebration-stage h2 {
    font-size: 32px;
    line-height: 1.1;
    margin: 0 0 12px
}

.celebration-copy {
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
    max-width: 580px;
    margin: 0 auto
}

.celebration-leader-note {
    text-align: left;
    margin: 18px auto 0;
    max-width: 570px;
    background: var(--surface2);
    border: 1px solid var(--line)
}

.celebration-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    margin: 18px 0 4px
}

.celebration-volume {
    display: grid;
    grid-template-columns: auto minmax(120px, 190px) 42px;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    background: var(--surface2);
    border-radius: 999px;
    padding: 7px 12px
}

.celebration-volume input {
    accent-color: var(--brand);
    width: 100%;
    cursor: pointer
}

.celebration-volume output {
    font-size: 10px;
    font-weight: 800;
    color: var(--muted)
}

.celebration-volume.muted {
    opacity: .52
}

.celebration-muted-note {
    color: var(--muted)
}

.celebration-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px
}

.celebration-effects {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1
}

.celebration-effects span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: #7ad6ff;
    opacity: 0;
    transform: translateY(-20px) rotate(0deg)
}

/* Rare: polished and restrained */
.celebration-stage.rarity-rare {
    width: min(620px, 100%);
    border-color: rgba(70, 155, 255, .35)
}

.celebration-stage.rarity-rare .celebration-banner {
    height: 122px
}

.celebration-stage.rarity-rare .celebration-badge-wrap {
    width: 100px;
    height: 100px
}

.celebration-stage.rarity-rare .celebration-badge {
    width: 86px;
    height: 86px
}

.celebration-stage.rarity-rare .celebration-ring {
    box-shadow: 0 0 0 7px rgba(82, 167, 255, .08), 0 0 26px rgba(82, 167, 255, .28)
}

.celebration-stage.rarity-rare .celebration-kicker {
    color: #2d78bf
}

/* Epic: deeper motion and purple energy */
.celebration-stage.rarity-epic {
    border-color: rgba(137, 94, 255, .5);
    box-shadow: 0 44px 120px rgba(25, 12, 95, .55)
}

.celebration-stage.rarity-epic .celebration-banner {
    height: 170px
}

.celebration-stage.rarity-epic .celebration-badge-wrap {
    width: 126px;
    height: 126px;
    transform: translateY(48px)
}

.celebration-stage.rarity-epic .celebration-badge {
    width: 108px;
    height: 108px
}

.celebration-stage.rarity-epic .celebration-ring {
    animation: epicPulse 2.6s ease-in-out infinite;
    border-color: #d8c8ff;
    box-shadow: 0 0 0 10px rgba(139, 95, 255, .09), 0 0 42px rgba(139, 95, 255, .48)
}

.celebration-stage.rarity-epic .celebration-kicker {
    color: #7a4bd4
}

.celebration-stage.rarity-epic .celebration-effects span:nth-child(-n+6) {
    opacity: .8;
    animation: celebrationFloat 3.4s ease-in-out infinite
}

/* Legendary: full banner, gold reveal, richer particles */
.celebration-stage.rarity-legendary {
    width: min(780px, 100%);
    border-color: rgba(255, 207, 78, .66);
    box-shadow: 0 50px 140px rgba(0, 0, 0, .62), 0 0 65px rgba(240, 177, 38, .14)
}

.celebration-stage.rarity-legendary:after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, .08) 40%, transparent 55%);
    transform: translateX(-100%);
    animation: legendarySweep 2.2s ease .35s 1;
    z-index: 4
}

.celebration-stage.rarity-legendary .celebration-banner {
    height: 244px;
    padding-bottom: 20px
}

.celebration-stage.rarity-legendary .celebration-rarity-line {
    top: 22px;
    color: #fff3c2
}

.celebration-stage.rarity-legendary .celebration-rarity-line span {
    background: #ffe49a
}

.celebration-stage.rarity-legendary .celebration-badge-wrap {
    width: 154px;
    height: 154px;
    transform: translateY(60px)
}

.celebration-stage.rarity-legendary .celebration-badge {
    width: 132px;
    height: 132px;
    animation: legendaryBadgeIn .8s cubic-bezier(.2, .9, .18, 1.15) both
}

.celebration-stage.rarity-legendary .celebration-ring {
    border-color: #ffe7a2;
    box-shadow: 0 0 0 12px rgba(255, 215, 103, .10), 0 0 52px rgba(255, 197, 59, .58);
    animation: legendaryRing 2.1s ease-in-out infinite
}

.celebration-stage.rarity-legendary .celebration-body {
    padding-top: 74px
}

.celebration-stage.rarity-legendary .celebration-kicker {
    color: #aa7410
}

.celebration-stage.rarity-legendary h2 {
    font-size: 40px
}

.celebration-stage.rarity-legendary .celebration-copy {
    font-size: 16px
}

.celebration-stage.rarity-legendary .celebration-effects span {
    opacity: .95;
    animation: legendaryConfetti 2.8s ease-out infinite
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(2n) {
    background: #ffd76a
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(3n) {
    background: #916dff
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(1) {
    left: 8%;
    animation-delay: .1s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(2) {
    left: 18%;
    animation-delay: .45s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(3) {
    left: 29%;
    animation-delay: .25s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(4) {
    left: 40%;
    animation-delay: .75s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(5) {
    left: 52%;
    animation-delay: .35s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(6) {
    left: 63%;
    animation-delay: .62s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(7) {
    left: 72%;
    animation-delay: .18s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(8) {
    left: 80%;
    animation-delay: .82s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(9) {
    left: 89%;
    animation-delay: .5s
}

.celebration-stage.rarity-legendary .celebration-effects span:nth-child(10) {
    left: 95%;
    animation-delay: .3s
}

@keyframes epicPulse {
    50% {
        transform: scale(1.045);
        box-shadow: 0 0 0 14px rgba(139, 95, 255, .06), 0 0 50px rgba(139, 95, 255, .56)
    }
}

@keyframes celebrationFloat {

    0%,
    100% {
        transform: translateY(20px) rotate(0);
        opacity: .15
    }

    50% {
        transform: translateY(-18px) rotate(120deg);
        opacity: .75
    }
}

@keyframes legendarySweep {
    to {
        transform: translateX(120%)
    }
}

@keyframes legendaryBadgeIn {
    0% {
        transform: scale(.55) rotate(-10deg);
        opacity: 0
    }

    70% {
        transform: scale(1.08) rotate(2deg);
        opacity: 1
    }

    100% {
        transform: scale(1) rotate(0)
    }
}

@keyframes legendaryRing {
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 0 16px rgba(255, 215, 103, .05), 0 0 64px rgba(255, 197, 59, .68)
    }
}

@keyframes legendaryConfetti {
    0% {
        top: -14px;
        transform: translateY(-10px) rotate(0);
        opacity: 0
    }

    14% {
        opacity: .95
    }

    100% {
        top: 72%;
        transform: translateY(60px) rotate(300deg);
        opacity: 0
    }
}

html[data-theme="dark"] .preference-block,
html[data-theme="dark"] .visual-choice,
html[data-theme="dark"] .celebration-volume {
    background: color-mix(in srgb, var(--surface2) 92%, #0b1025)
}

html[data-theme="dark"] .celebration-stage {
    background: #11162b;
    border-color: #2d3657
}

html[data-theme="dark"] .celebration-copy {
    color: #b8c3df
}

html[data-theme="dark"] .celebration-stage.rarity-legendary {
    border-color: rgba(255, 207, 78, .56)
}

html[data-theme="dark"] .celebration-stage.rarity-legendary .celebration-kicker {
    color: #ffd979
}

html[data-theme="dark"] .celebration-stage.rarity-epic .celebration-kicker {
    color: #c2a7ff
}

html[data-theme="dark"] .celebration-stage.rarity-rare .celebration-kicker {
    color: #82c5ff
}

@media(max-width:760px) {
    .icon-visual-picker {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .banner-visual-picker {
        grid-template-columns: 1fr
    }

    .celebration-backdrop {
        padding: 10px
    }

    .celebration-stage {
        border-radius: 22px;
        max-height: 96vh
    }

    .celebration-stage.rarity-legendary .celebration-banner {
        height: 200px
    }

    .celebration-stage.rarity-legendary h2 {
        font-size: 32px
    }

    .celebration-body {
        padding-left: 20px;
        padding-right: 20px
    }

    .celebration-controls,
    .celebration-actions {
        flex-direction: column
    }

    .celebration-volume {
        width: 100%;
        grid-template-columns: auto 1fr 42px
    }

    .celebration-actions .btn {
        width: 100%
    }

    .media-selection-heading {
        align-items: flex-start;
        flex-direction: column
    }
}

@media(max-width:480px) {
    .icon-visual-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(prefers-reduced-motion:reduce) {

    .celebration-stage,
    .celebration-backdrop,
    .visual-choice {
        transition: none !important
    }

    .celebration-effects span,
    .celebration-ring,
    .celebration-stage.rarity-legendary:after,
    .celebration-stage.rarity-legendary .celebration-badge {
        animation: none !important
    }
}

/* v1.4 — People directory, profile photos, and media management */
.avatar-image {
    object-fit: cover;
    display: block;
    background: var(--surface2)
}

.avatar-xl {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    font-size: 20px
}

.avatar-hero {
    width: 92px;
    height: 92px;
    flex: 0 0 92px;
    font-size: 30px;
    box-shadow: 0 12px 30px rgba(48, 40, 255, .18)
}

.people-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px
}

.people-search-wrap {
    flex: 1;
    max-width: 620px;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(30, 39, 82, .035)
}

.people-search-wrap>span {
    color: var(--muted);
    font-size: 18px
}

.people-search-wrap input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    padding: 11px 0
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px
}

.person-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 220px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 10px 28px rgba(30, 40, 80, .045);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease
}

.person-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
    box-shadow: 0 16px 34px rgba(35, 42, 95, .09)
}

.person-card-top {
    display: flex;
    align-items: center;
    gap: 14px
}

.person-card-copy {
    min-width: 0
}

.person-card h3,
.public-profile-hero h2 {
    margin: 0
}

.person-card p,
.public-profile-hero p {
    margin: 4px 0 0;
    color: var(--muted)
}

.person-track-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px
}

.person-card-footer {
    margin-top: auto;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 7px;
    align-items: baseline;
    color: var(--muted);
    font-size: 12px
}

.person-card-footer strong {
    color: var(--text);
    font-size: 18px
}

.person-card-footer b {
    color: var(--brand);
    font-size: 11px
}

.public-profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, #3028ff 8%), var(--surface));
    box-shadow: var(--shadow)
}

.public-profile-identity {
    display: flex;
    align-items: center;
    gap: 18px
}

.profile-track-list {
    margin-top: 12px
}

.public-profile-stat {
    min-width: 190px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface2);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px
}

.public-profile-stat strong {
    font-size: 30px;
    line-height: 1
}

.public-profile-stat span {
    color: var(--muted);
    font-size: 12px
}

.public-profile-stat .btn {
    margin-top: 8px
}

.public-profile-rarity {
    margin: 16px 0 4px
}

.public-achievement-card {
    cursor: default
}

.public-achievement-card:hover {
    transform: none
}

.public-achievement-copy p {
    margin: 6px 0 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

.public-achievement-copy small {
    color: var(--muted)
}

.profile-empty {
    margin-top: 18px
}

.profile-photo-panel {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px
}

.profile-photo-preview {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0
}

.profile-photo-preview h3 {
    margin: 0 0 5px
}

.profile-photo-preview p {
    margin: 0;
    max-width: 560px;
    font-size: 12px;
    line-height: 1.45
}

.profile-photo-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end
}

.profile-photo-upload {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap
}

.file-picker {
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--input)
}

.compact-file-picker {
    width: min(360px, 100%)
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none
}

.file-picker-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    background: var(--surface2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease
}

.file-picker-button:hover {
    border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
    background: color-mix(in srgb, var(--surface2) 86%, var(--brand) 14%)
}

.file-picker-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px
}

.file-picker.has-file .file-picker-name {
    color: var(--text)
}

.asset-card-actions {
    min-height: 34px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}

.media-protected,
.media-in-use,
.media-unused {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em
}

.media-protected {
    color: var(--muted)
}

.media-in-use {
    color: #a16b00
}

.media-unused {
    color: var(--success)
}

.danger-btn {
    background: #ffe7eb;
    color: #a9253a
}

.danger-text {
    color: var(--danger) !important
}

.btn:disabled {
    opacity: .48;
    cursor: not-allowed
}

.people-admin-toolbar {
    align-items: center;
    gap: 14px
}

.admin-people-search {
    max-width: 430px;
    margin-right: auto
}

.table-person-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 180px
}

.table-person-cell strong {
    color: var(--text)
}

.profile-view-row {
    margin-top: 16px
}

@media(max-width:1050px) {
    .people-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .profile-photo-panel {
        align-items: flex-start;
        flex-direction: column
    }

    .profile-photo-actions {
        justify-content: flex-start;
        width: 100%
    }
}

@media(max-width:760px) {

    .people-toolbar,
    .public-profile-hero,
    .people-admin-toolbar {
        align-items: stretch;
        flex-direction: column
    }

    .people-search-wrap,
    .admin-people-search {
        max-width: none;
        width: 100%
    }

    .people-grid {
        grid-template-columns: 1fr
    }

    .public-profile-identity {
        align-items: flex-start
    }

    .public-profile-stat {
        width: 100%
    }

    .profile-photo-preview {
        align-items: flex-start
    }

    .profile-photo-upload {
        width: 100%
    }

    .compact-file-picker {
        width: 100%
    }
}

.file-field-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 750;
    color: var(--muted)
}

/* v1.6 — Premium Achievement Plaque. One self-contained, responsive component. */
.ga-public-plaque-section {
    margin: 22px 0 26px;
}

.ga-feature-picker-panel {
    margin: 0 0 18px;
}

.ga-feature-picker-intro {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 18px;
}

.ga-feature-picker-intro h2 {
    margin: 4px 0 7px;
}

.ga-feature-picker-intro p {
    max-width: 680px;
    margin: 0;
    line-height: 1.5;
}

.ga-feature-picker-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 16px;
}

.ga-feature-picker-form label {
    font-size: 12px;
    font-weight: 750;
    flex-basis: 100%;
    margin-bottom: -7px;
}

.ga-feature-picker-form select {
    flex: 1 1 300px;
    max-width: 590px;
    min-width: 0;
}

.ga-feature-preview-title {
    margin: 14px 0 12px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 800;
    letter-spacing: .035em;
}

.ga-plaque {
    --ga-accent: #9bafdb;
    --ga-glow: rgba(153, 174, 215, .12);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: #f8faff;
    padding: 52px 22px 23px;
    border-radius: 20px;
    border: 1px solid var(--ga-accent);
    background: radial-gradient(ellipse at 20% 55%, rgba(24, 63, 158, .30), transparent 40%),
        linear-gradient(137deg, #080f25 0%, #101c37 55%, #0a142b 100%);
    box-shadow: inset 0 0 0 3px rgba(3, 7, 26, .5),
        0 0 0 1px var(--ga-glow),
        0 12px 38px rgba(1, 8, 32, .24);
}

.ga-plaque:after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255, 255, 255, .065);
    border-radius: 13px;
    z-index: -1;
    pointer-events: none;
}

.ga-plaque--legendary {
    --ga-accent: #e2bd68;
    --ga-glow: rgba(227, 184, 91, .22);
    box-shadow: inset 0 0 0 3px rgba(3, 7, 26, .5), 0 0 0 1px var(--ga-glow), 0 0 24px rgba(229, 181, 83, .12), 0 15px 38px rgba(1, 8, 32, .25);
}

.ga-plaque--epic {
    --ga-accent: #b68bff;
    --ga-glow: rgba(175, 115, 254, .16);
}

.ga-plaque--rare {
    --ga-accent: #71baff;
    --ga-glow: rgba(83, 155, 255, .16);
}

.ga-plaque--uncommon {
    --ga-accent: #69cbac;
    --ga-glow: rgba(88, 203, 170, .12);
}

.ga-plaque-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 22px;
    color: #ffe0a0;
    background: linear-gradient(105deg, rgba(119, 75, 10, .50), rgba(14, 23, 45, .96));
    border-right: 1px solid var(--ga-accent);
    border-bottom: 1px solid var(--ga-accent);
    border-bottom-right-radius: 17px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .115em;
    line-height: 1.3;
}

.ga-plaque-ribbon-star {
    font-size: 17px;
    line-height: 1;
}

.ga-plaque-grid {
    display: grid;
    grid-template-columns: minmax(175px, 236px) minmax(0, 1fr);
    gap: clamp(20px, 3.2vw, 38px);
    align-items: center;
    width: 100%;
    min-width: 0;
}

.ga-plaque-medal-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 6px 0 12px;
}

.ga-plaque-medal-halo {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 238px);
    aspect-ratio: 1;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(45, 106, 237, .23) 12%, rgba(13, 28, 73, .12) 56%, transparent 70%);
}

.ga-plaque-medal-halo:before {
    content: "";
    position: absolute;
    inset: 6%;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    box-shadow: 0 0 40px var(--ga-glow);
}

.ga-plaque-medal {
    display: block;
    position: relative;
    width: 94%;
    max-height: 226px;
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 14px 15px rgba(0, 0, 0, .47));
}

.ga-plaque-medal-label {
    color: #aebddd;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.ga-plaque-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 17px;
}

.ga-plaque-banner {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 11px;
    border: 1px solid rgba(147, 180, 240, .24);
    background: #0b193b;
}

.ga-plaque-banner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center;
}

.ga-plaque-banner-fallback {
    position: relative;
    align-content: center;
    gap: 4px;
    text-align: center;
    background: radial-gradient(ellipse at 45% 24%, rgba(58, 133, 255, .4), transparent 48%), linear-gradient(135deg, #0a1635, #123e9a 48%, #0b1b48);
}

.ga-plaque-banner-fallback:before,
.ga-plaque-banner-fallback:after {
    content: "";
    position: absolute;
    inset: 11px;
    border: 1px solid rgba(180, 208, 255, .13);
    border-radius: 6px;
    pointer-events: none;
}

.ga-plaque-banner-fallback:after {
    inset: 21px;
    border-style: dashed;
    opacity: .4;
}

.ga-plaque-fallback-orbit {
    color: #d6b96d;
    font-size: 22px;
    line-height: 1.1;
}

.ga-plaque-fallback-title {
    color: #f9faff;
    font-size: clamp(17px, 2.3vw, 26px);
    font-weight: 800;
    line-height: 1.15;
    max-width: 90%;
    text-wrap: balance;
}

.ga-plaque-fallback-subtitle {
    color: #b3c6ed;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.ga-plaque-copy h3 {
    margin: 0 0 10px;
    font-size: clamp(23px, 2.5vw, 34px);
    line-height: 1.14;
    letter-spacing: -.035em;
    color: #fff;
}

.ga-plaque-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 20px;
}

.ga-plaque-rarity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e3ca8e;
    font-weight: 850;
    font-size: 13px;
}

.ga-plaque-rarity span {
    color: var(--ga-accent);
    font-size: 17px;
}

.ga-plaque-earned {
    font-size: 12px;
    color: #c3ceeb;
}

.ga-plaque-copy p {
    color: #ced8ee;
    font-size: 13px;
    line-height: 1.6;
    margin: 11px 0 0;
    max-width: 72ch;
}

@media(max-width: 770px) {
    .ga-plaque {
        padding: 49px 16px 18px;
    }

    .ga-plaque-grid {
        grid-template-columns: 146px minmax(0, 1fr);
        gap: 14px;
    }

    .ga-plaque-medal-label {
        font-size: 9px;
    }
}

@media(max-width: 560px) {
    .ga-feature-picker-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .ga-feature-picker-form {
        flex-direction: column;
        align-items: stretch;
    }

    .ga-feature-picker-form select,
    .ga-feature-picker-form button {
        width: 100%;
        max-width: none;
        flex: none;
    }

    .ga-feature-picker-form label {
        margin-bottom: -5px;
    }

    .ga-plaque-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .ga-plaque-medal-column {
        padding: 0;
        gap: 2px;
    }

    .ga-plaque-medal-halo {
        width: 142px;
    }

    .ga-plaque-medal {
        max-height: 136px;
    }

    .ga-plaque-medal-label {
        display: none;
    }

    .ga-plaque-details {
        gap: 12px;
    }

    .ga-plaque-copy h3 {
        font-size: 23px;
    }

    .ga-plaque-ribbon {
        font-size: 9px;
    }
}
/* v1.7 — Audit Log readability without redesigning the page */
.audit-table th:first-child { min-width: 155px }
.audit-table th:nth-child(2) { min-width: 185px }
.audit-table th:nth-child(3) { min-width: 145px }
.audit-table td { vertical-align: top; line-height: 1.5 }
.audit-time-cell { white-space: nowrap; color: var(--muted) }
.audit-action-label { display: block; font-weight: 750 }
.audit-subject { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere }
.audit-actor-cell { white-space: nowrap }
.audit-actor-dot { color: var(--brand); font-size: 8px; vertical-align: middle; margin-right: 4px }
.audit-details-cell { min-width: 270px; max-width: 540px; overflow-wrap: anywhere }
.audit-note { margin-bottom: 7px }
.audit-fact { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 5px; font-size: 12px }
.audit-fact > span { color: var(--muted); flex-shrink: 0 }
.audit-fact > strong { font-weight: 600; overflow-wrap: anywhere }
.audit-changes { margin-top: 8px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2) }
.audit-changes summary { cursor: pointer; color: var(--text); font-size: 12px; font-weight: 750 }
.audit-change-list { display: grid; gap: 10px; margin-top: 9px }
.audit-change-item strong { display: block; margin-bottom: 3px; font-size: 12px }
.audit-change-values { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; font-size: 12px; overflow-wrap: anywhere }
.audit-change-values > span:first-child { color: var(--muted) }
.audit-change-values .audit-change-arrow { color: var(--brand); font-weight: 750 }
.audit-change-values > span:last-child { font-weight: 650 }
.audit-empty { padding: 26px !important; text-align: center; color: var(--muted) }

/* v1.8 — administration UX: scalable media filtering and account lifecycle */
.media-filter-bar{display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin-bottom:18px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface2)}
.media-filter-bar label{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:750;color:var(--muted);flex:1 1 125px;min-width:125px}
.media-filter-bar label.media-search-field{flex:2 1 220px}
.media-filter-bar input,.media-filter-bar select{width:100%;min-width:0;padding:10px;border:1px solid var(--line);border-radius:9px;color:var(--text);background:var(--surface);font:inherit;font-size:12px}
.media-filter-bar .btn{min-height:37px}
.media-assets-panel .asset-card-actions{align-items:center}
.media-details-dialog{border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--text);width:min(92vw,650px);max-height:min(86vh,900px);overflow-y:auto;padding:22px;box-shadow:0 25px 80px rgba(0,0,0,.35)}
.media-details-dialog::backdrop{background:rgba(3,9,28,.74);backdrop-filter:blur(3px)}
.media-dialog-top,.media-dialog-heading,.media-assignment-row,.media-dialog-footer,.account-action-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.media-dialog-top small,.media-dialog-heading small,.media-assignment-row small,.account-action-row small{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.media-dialog-top h3{margin:6px 0 0}
.media-dialog-preview{width:100%;max-height:270px;object-fit:contain;border-radius:12px;margin:15px 0;background:var(--surface2)}
.media-dialog-preview.banner{aspect-ratio:3/1;max-height:none;object-fit:contain}
.media-dialog-audio{width:100%;margin:18px 0}
.media-dialog-heading{border-top:1px solid var(--line);padding-top:16px;margin-bottom:12px;align-items:flex-start}
.media-assignment-list{max-height:320px;overflow-y:auto;border:1px solid var(--line);border-radius:12px}
.media-assignment-row{padding:12px;min-height:58px;flex-wrap:wrap}
.media-assignment-row+.media-assignment-row{border-top:1px solid var(--line)}
.media-assignment-row strong{font-size:12px}
.media-dialog-footer{margin-top:15px;border-top:1px solid var(--line);padding-top:16px}
.media-pagination{display:flex;align-items:center;justify-content:center;gap:15px;margin-top:20px;font-size:12px}
.account-state{display:inline-block;white-space:nowrap;font-size:10px;font-weight:800;padding:5px 9px;border-radius:20px;border:1px solid var(--line)}
.account-state.is-active{color:#167346;background:rgba(34,197,94,.1)}
.account-state.is-pending{color:#89651a;background:rgba(235,176,48,.12)}
.account-state.is-inactive{color:#9c3c4c;background:rgba(209,58,80,.1)}
.account-status-box,.account-action-row{padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface2)}
.account-status-box{display:flex;justify-content:space-between;align-items:center;gap:12px}
.account-status-box p{margin:4px 0 0}
.account-delete-details{border-top:1px solid var(--line);padding-top:14px}
.account-delete-details summary{cursor:pointer;font-size:12px;font-weight:800;color:var(--danger)}
.account-delete-details p{font-size:12px;line-height:1.6}
.account-delete-blockers{color:var(--danger);padding:10px;background:rgba(210,45,70,.07);border-radius:8px}
.admin-status-filter{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
.admin-status-filter select{color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:9px}
@media(max-width:700px){.media-details-dialog{padding:14px;width:96vw}.media-filter-bar{padding:10px}.admin-status-filter{width:100%}}
