:root {
    --olive: #2a2c1f;
    --paper: #efece4;
    --card: #ffffff;
    --ink: #24261c;
    --muted: #6d6a5e;
    --rose: #8d4530;
    --brass: #a68456;
    --cream: #e6dcc8;
    --line: #e4dfd4;
    --side: 248px;
    --top: 68px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a { color: var(--rose); }
img { max-width: 100%; }
button, input { font: inherit; }

.side {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side);
    display: flex;
    flex-direction: column;
    background: var(--olive);
    color: var(--cream);
    padding: 1.15rem 0.85rem 1rem;
    z-index: 40;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--cream);
    text-decoration: none;
    padding: 0.15rem 0.45rem 1.15rem;
}

.side-brand img {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    object-fit: cover;
}

.side-brand strong { display: block; font-size: 1.02rem; font-weight: 600; }
.side-brand small {
    display: block;
    color: #c9c0ad;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-nav { display: flex; flex-direction: column; gap: 0.2rem; }

.side-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #ddd6c6;
    text-decoration: none;
    border-radius: 12px;
    padding: 0.62rem 0.75rem;
    font-weight: 500;
}

.side-nav a svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.side-nav a:hover { background: rgba(230, 220, 200, 0.08); }
.side-nav a.on { background: var(--cream); color: var(--olive); }

.maincol { margin-left: var(--side); min-width: 0; min-height: 100vh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 1.4rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.top-title { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; }
.top-tools { display: flex; align-items: center; gap: 0.35rem; }

.icon-btn.nav-toggle { display: none; }

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--olive);
    cursor: pointer;
    display: grid;
    place-items: center;
}

a.icon-btn { text-decoration: none; color: var(--olive); }
.icon-btn:hover { background: var(--paper); }
.icon-btn.danger { color: var(--rose); }
.icon-btn.danger:hover { background: #f6ebe6; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--rose);
    color: white;
    font-size: 0.65rem;
    line-height: 16px;
    text-align: center;
}

.menu { position: relative; }

.pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(42, 44, 31, 0.16);
    border: 1px solid var(--line);
    padding: 0.35rem;
}

.pop-title {
    margin: 0;
    padding: 0.5rem 0.65rem 0.35rem;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pop a, .pop .empty {
    display: block;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}

.pop a:hover { background: var(--paper); }
.pop a strong, .pop a span { display: block; }
.pop a span, .pop .empty { color: var(--muted); font-size: 0.82rem; font-weight: 400; }

.studio-switch { max-width: 15rem; }
.studio-switch-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    max-width: 100%;
    border: 1px solid var(--line);
    background: white;
    border-radius: 999px;
    padding: 0.28rem 0.65rem 0.28rem 0.28rem;
    color: inherit;
    cursor: pointer;
}
.studio-switch-btn:disabled {
    cursor: default;
    opacity: 1;
}
.studio-switch-btn:not(:disabled):hover { background: var(--paper); }
.studio-switch-btn > svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    flex: none;
}
.studio-switch-mark {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--olive);
    color: var(--cream);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: none;
    font-size: 0.72rem;
    font-weight: 600;
}
.studio-switch-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}
.studio-switch-copy {
    min-width: 0;
    text-align: left;
}
.studio-switch-copy strong,
.studio-switch-copy em { display: block; }
.studio-switch-copy strong {
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.studio-switch-copy em {
    color: var(--muted);
    font-size: 0.68rem;
    font-style: normal;
}
.pop-switch { width: min(16rem, calc(100vw - 2rem)); }
.pop-switch a {
    display: block;
    margin: 0.35rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    color: var(--olive);
    text-decoration: none;
}
.pop-switch a:hover { background: var(--paper); }
.pop-switch .current-studio {
    margin: 0 0.35rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: var(--paper);
    color: var(--olive);
    font-weight: 600;
}
.pop-switch form.switch { margin: 0 0.35rem; }
.pop-switch form.switch button {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    color: var(--olive);
    text-align: left;
}
.pop-switch form.switch button:hover { background: var(--paper); }

.profile {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border-radius: 999px;
    color: inherit;
}

.profile:hover { background: var(--paper); }
.profile > svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--olive);
    color: var(--cream);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    object-fit: cover;
}

.who strong, .who span { display: block; text-align: left; }
.who strong { font-size: 0.88rem; }
.who span { color: var(--muted); font-size: 0.72rem; }

.pop-account {
    width: min(20rem, calc(100vw - 2rem));
    padding: 0.55rem;
}
.pop-account .account-card {
    display: grid;
    gap: 0.15rem;
    margin: 0 0 0.45rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    background: var(--paper);
}
.pop-account .account-card strong {
    font-size: 0.92rem;
    color: var(--ink);
    line-height: 1.25;
}
.pop-account .account-email {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-transform: none;
    letter-spacing: 0;
}
.pop-account .account-links {
    display: grid;
    gap: 0.1rem;
}
.pop-account .account-links a,
.pop-account a {
    display: block;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    color: var(--olive);
    text-decoration: none;
}
.pop-account .account-links a:hover,
.pop-account a:hover { background: var(--paper); }
.pop-account form { margin: 0.45rem 0 0; }
.pop-account button {
    width: 100%;
    border: 0;
    background: var(--paper);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    color: var(--olive);
    text-align: left;
}
.pop-account form:not(.switch) button { text-align: center; }
.pop-account .current-studio {
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: var(--paper);
    color: var(--olive);
    font-weight: 600;
}
.pop-account form.switch { margin: 0; }
.pop-account form.switch button { background: transparent; text-align: left; }
.pop-account form.switch button:hover { background: var(--paper); }

.scrim { display: none; }

.content { padding: 1.35rem 1.5rem 2.6rem; }

.flash {
    background: #efe6d4;
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    margin: 0 0 1rem;
}

.lede { margin: 0 0 1rem; color: var(--muted); max-width: 42rem; }

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card);
    border-radius: 18px;
    padding: 1.05rem 1.1rem;
    box-shadow: 0 10px 28px rgba(42, 44, 31, 0.05);
    color: inherit;
    text-decoration: none;
}

.stat strong { display: block; font-size: 1.9rem; letter-spacing: -0.04em; line-height: 1; }
.stat em { display: block; margin-top: 0.35rem; color: var(--muted); font-style: normal; font-size: 0.84rem; }
.stat i {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #f3eee4;
    color: var(--olive);
}
.stat i svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stat:nth-child(2) i { color: var(--rose); background: #f6ebe6; }
.stat:nth-child(3) i { color: #8a6a32; background: #f6f0e4; }
.stat:nth-child(4) i { color: #3f6b4a; background: #e7f0e4; }

.panel {
    background: var(--card);
    border-radius: 18px;
    padding: 1.1rem 1.15rem 1.2rem;
    box-shadow: 0 10px 28px rgba(42, 44, 31, 0.05);
    margin-bottom: 1rem;
}

.panel h2 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.9rem; }
.hint { color: var(--muted); font-size: 0.86rem; margin: 0.25rem 0 0; }
#status-line { margin: 0 0 0.85rem; }
.errors { color: var(--rose); font-size: 0.86rem; margin: 0.3rem 0; }

.actions, .modes { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }

a.btn, .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
a.btn { text-decoration: none; color: var(--ink); }
.btn {
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    border-radius: 11px;
    padding: 0.48rem 0.85rem;
    font-size: 0.88rem;
    cursor: pointer;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn.primary, .btn.on { background: var(--olive); color: var(--cream); border-color: var(--olive); }
.quiet { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.8rem; padding: 0.15rem 0.2rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.tile { position: relative; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 0.55rem; box-shadow: 0 8px 22px rgba(42, 44, 31, 0.04); }
.tile-remove { position: absolute; top: 0.85rem; right: 0.85rem; margin: 0; z-index: 1; }
.tile-remove .icon-btn {
    width: 32px;
    height: 32px;
    background: white;
    box-shadow: 0 4px 12px rgba(42, 44, 31, 0.12);
}
.tile-media {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 42%, hsl(40 34% 95%), hsl(36 18% 84%));
}
.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tile a { position: relative; display: block; color: inherit; text-decoration: none; }
.tile strong { display: block; margin: 0.55rem 0.2rem 0.15rem; font-size: 0.92rem; }
.colour-switches { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.15rem 0 0.35rem; }
.colour-switches button {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--line);
    cursor: pointer;
}
.colour-switches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--olive); }
.tools h2 { margin: 1rem 0 0.45rem; font-size: 0.92rem; }
.tools h2:first-child { margin-top: 0; }
.background-picks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0.2rem 0 0.55rem;
}
.background-pick {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #faf8f3;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.background-pick:hover { background: white; }
.background-pick[aria-pressed="true"] {
    border-color: var(--olive);
    box-shadow: inset 0 0 0 1px var(--olive);
    background: white;
}
.background-pick-swatch {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(42, 44, 31, 0.08);
    background: linear-gradient(#efece4 62%, #d7c4a4 62%);
    background-size: cover;
    background-position: center;
    display: block;
}
.background-pick.is-photo .background-pick-swatch {
    background-image:
        linear-gradient(45deg, #ebe4d7 25%, transparent 25%),
        linear-gradient(-45deg, #ebe4d7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ebe4d7 75%),
        linear-gradient(-45deg, transparent 75%, #ebe4d7 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
    background-color: #f7f2e8;
}
.background-pick-name {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.background-add { margin: 0 0 0.35rem; width: 100%; }
.colour-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.colour-pair input[type="color"] { display: block; width: 100%; height: 42px; margin-top: 0.3rem; padding: 0.2rem; border: 1px solid var(--line); border-radius: 11px; background: white; }
.background-form { display: grid; gap: 0.75rem; }
.background-form > .hint { margin: -0.2rem 0 0.1rem; }
.background-colours {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.7rem 0.85rem;
    background: #faf8f3;
}
.background-colours summary {
    cursor: pointer;
    color: var(--olive);
    font-weight: 600;
}
.background-colours .colour-pair { margin-top: 0.7rem; }
.background-own {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0.35rem 0;
}
.background-own span {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.background-own img,
.background-own i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--line);
    flex: none;
    object-fit: cover;
    display: block;
}
.background-own form { margin: 0; }

label { display: block; margin: 0.7rem 0; font-size: 0.88rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    border: 1px solid var(--line);
    background: #faf8f3;
    border-radius: 11px;
    padding: 0.55rem 0.7rem;
}
input[type="range"] { width: 100%; accent-color: var(--olive); }
.check { display: flex; gap: 0.45rem; align-items: center; }
.check input { width: auto; margin: 0; }

dialog {
    border: 0;
    border-radius: 18px;
    padding: 1.2rem 1.25rem;
    width: min(420px, calc(100% - 2rem));
    box-shadow: 0 24px 60px rgba(42, 44, 31, 0.22);
}
dialog::backdrop { background: rgba(42, 44, 31, 0.45); }
dialog h2 { margin: 0 0 0.8rem; font-size: 1.15rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 1rem; align-items: start; }
.stage {
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(42, 44, 31, 0.05);
    overflow: hidden;
}
.frame { position: relative; }
.view-switch {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 2;
    display: flex;
    gap: 0.35rem;
}
.view-switch .icon-btn { background: white; box-shadow: 0 4px 12px rgba(42, 44, 31, 0.12); }
#model { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 35%, hsl(40 34% 90%), hsl(36 24% 76%)); }
#model canvas { width: 100%; height: 100%; display: block; }
.model-toolbar {
    pointer-events: none;
    position: absolute;
    inset: auto 0.5rem 0.5rem;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.5rem;
    z-index: 2;
}
.model-hint {
    margin: 0;
    max-width: 16rem;
    padding: 0.35rem 0.5rem;
    background: hsl(40 34% 92% / 0.85);
    color: var(--ink);
    font-size: 0.68rem;
    line-height: 1.35;
}
.model-controls {
    pointer-events: auto;
    margin-left: auto;
    display: flex;
    gap: 1px;
    background: color-mix(in srgb, var(--ink) 15%, transparent);
}
.model-controls button {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: hsl(40 38% 93% / 0.92);
    color: var(--ink);
    cursor: pointer;
}
.model-controls button:hover { background: hsl(40 38% 98%); }
.model-controls button[aria-pressed="true"] { background: white; }
.model-controls svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.frame.is-model #view,
.frame.is-model .angle { visibility: hidden; }
.stage.is-model .turn { display: none; }
#model.is-photo-turn {
    background: transparent;
    pointer-events: none;
}
#model.is-photo-turn .model-toolbar { pointer-events: auto; }
.frame.is-turntable .angle { visibility: hidden; }
.stage.is-turntable .turn { display: none; }
@media (max-width: 640px) {
    .model-hint { display: none; }
}
#view {
    width: 100%;
    height: auto;
    background: #faf8f3;
    cursor: crosshair;
    display: block;
    touch-action: none;
}
#view.spinning { cursor: ew-resize; }
#view.looking { cursor: default; }
.share-link { display: grid; gap: 0.45rem; margin: 0.9rem 0 0.2rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 0.8rem; }
.share-link .share-actions { margin: 0; }
.share-link label { display: grid; gap: 0.2rem; font-size: 0.82rem; color: var(--muted); }
.share-link input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 0.48rem 0.7rem; background: #faf8f3; color: var(--ink); }
.share-bar { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem; }
.share-bar img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.share-bar img.studio-mark { width: auto; max-width: 180px; height: 44px; object-fit: contain; background: white; border-radius: 8px; }
.studio-logo {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    margin: 0;
    flex: none;
}
.studio-logo.empty {
    display: grid;
    place-items: center;
    background: #f7f3ea;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
    padding: 0.6rem;
}
.studio-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.1rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(230, 220, 200, 0.55), rgba(239, 236, 228, 0.2)),
        var(--card);
    box-shadow: 0 10px 28px rgba(42, 44, 31, 0.05);
}
.studio-hero-mark {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--olive);
    color: var(--cream);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: none;
    box-shadow: inset 0 0 0 1px rgba(230, 220, 200, 0.18);
}
.studio-hero-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}
.studio-hero-mark span {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.04em;
}
.studio-hero-copy { min-width: 0; flex: 1; }
.studio-hero-copy .kicker {
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.studio-hero-copy h2 {
    margin: 0;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.studio-hero-copy p {
    margin: 0.25rem 0 0;
    color: var(--muted);
}
.studio-hero-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.studio-hero-actions form { margin: 0; }
.studio-settings {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(17rem, 23rem);
    gap: 1rem;
    align-items: start;
}
.studio-settings-main,
.studio-settings-side { min-width: 0; }
.studio-settings-side .assign-panel {
    position: sticky;
    top: 5.2rem;
}
.studio-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: end;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
.studio-inline-form label { margin: 0; }
.studio-inline-form .btn { margin: 0; min-height: 42px; }
.studio-logo-panel {
    display: grid;
    gap: 0.9rem;
}
.studio-logo-preview {
    display: flex;
    gap: 0.9rem;
    align-items: center;
}
.studio-logo-preview strong { display: block; }
.studio-logo-preview .hint { margin-top: 0.2rem; }
.studio-upload { display: grid; gap: 0.75rem; }
.file-pick {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0;
    padding: 0.85rem 0.95rem;
    border: 1px dashed rgba(42, 44, 31, 0.22);
    border-radius: 14px;
    background: #faf8f3;
    cursor: pointer;
}
.file-pick:hover { border-color: var(--olive); background: white; }
.file-pick input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
}
.file-pick-copy strong,
.file-pick-copy em { display: block; }
.file-pick-copy strong { color: var(--ink); font-size: 0.92rem; }
.file-pick-copy em {
    margin-top: 0.15rem;
    color: var(--muted);
    font-style: normal;
    font-size: 0.8rem;
}
.studio-people {
    display: grid;
    gap: 0.55rem;
}
.studio-person {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #faf8f3;
}
.studio-person-copy { min-width: 0; }
.studio-person-copy strong {
    display: block;
    font-size: 0.95rem;
}
.studio-person-copy span {
    display: block;
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}
.studio-list {
    display: grid;
    gap: 0.7rem;
}
.studio-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #faf8f3;
}
.studio-card.on {
    border-color: rgba(42, 44, 31, 0.18);
    background: white;
    box-shadow: 0 8px 20px rgba(42, 44, 31, 0.05);
}
.studio-card-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--olive);
    color: var(--cream);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: none;
}
.studio-card-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}
.studio-card-mark span {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}
.studio-card-copy {
    min-width: 0;
    flex: 1;
}
.studio-card-copy strong {
    display: block;
    font-size: 1rem;
    letter-spacing: -0.02em;
}
.studio-card-copy span {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.84rem;
}
.studio-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}
.studio-card-actions form { margin: 0; }
.share-bar strong { display: block; }
.share-bar span { color: var(--muted); font-size: 0.82rem; }
.share-main { max-width: 980px; padding: 0 1.5rem 2.5rem; }
.share-main h1 { margin: 0 0 0.3rem; font-size: 1.4rem; }
.share-main .lede { margin: 0 0 1rem; color: var(--muted); }
.angle {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.78rem;
}
.turn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    border-top: 1px solid var(--line);
}
.turn button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: none;
}
.turn button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.turn input[type="range"] { flex: 1; }
.workspace aside h2 { margin: 1.05rem 0 0.4rem; }
.workspace aside h2:first-child { margin-top: 0; }
.tools .slider { display: grid; gap: 0.15rem; margin: 0.65rem 0; }
.tools .slider span { display: flex; justify-content: space-between; font-size: 0.82rem; }
.cloth-types { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.7rem; }
.cloth-types button {
    border: 1px solid var(--line);
    background: #faf8f3;
    color: var(--ink);
    border-radius: 999px;
    padding: 0.28rem 0.62rem;
    font-size: 0.75rem;
    cursor: pointer;
}
.cloth-types button[aria-pressed="true"] { background: var(--olive); color: var(--cream); border-color: var(--olive); }
.tool-icons { display: flex; gap: 0.4rem; margin-top: 0.35rem; }
.tool-icons .icon-btn,
.tool-head .icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 12px;
}
.tool-icons .icon-btn.on,
.tool-icons .icon-btn.primary {
    background: var(--olive);
    color: var(--cream);
    border-color: var(--olive);
}
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1.05rem; }
.workspace aside .tool-head h2 { margin: 0; }
#reading:empty { display: none; }
#reading { margin-top: 0.55rem; padding: 0.55rem 0.7rem; background: #faf8f3; border-radius: 12px; }
.surface-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.55rem 0 0.2rem; }
.surface-list .btn.on { background: var(--olive); color: var(--cream); border-color: var(--olive); }
.swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.swatch {
    width: 76px;
    padding: 0;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #faf8f3;
    cursor: pointer;
    overflow: hidden;
    text-align: center;
}
.swatch img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.swatch span { display: block; padding: 0.28rem 0.2rem 0.4rem; font-size: 0.68rem; color: var(--muted); }
.swatch[aria-pressed="true"] { border-color: var(--olive); }
.swatch[aria-pressed="true"] span { color: var(--olive); }

.form-card { max-width: 36rem; }
.back {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.86rem;
    margin-bottom: 0.55rem;
}
.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: var(--ink); }
.fields.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.role {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin: 0.3rem 0 0.8rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #faf8f3;
}
.role input { width: auto; margin: 0.2rem 0 0; }
.role strong { display: block; }
.role span span { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.studio-pick {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 11rem;
    gap: 0.7rem;
    align-items: start;
    margin: 0.45rem 0;
}
.studio-pick label { margin: 0; }
.studio-pick .role { margin: 0; }
.studio-pick select { margin-top: 0.3rem; }
.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    gap: 1rem;
    align-items: start;
}
.profile-layout .form-card { max-width: none; }
.identity { display: flex; align-items: center; gap: 1rem; }
.identity .avatar { width: 72px; height: 72px; font-size: 1.35rem; flex: none; }
.identity h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.03em; }
.identity p { margin: 0.15rem 0 0; color: var(--muted); }
.stats.pair { grid-template-columns: 1fr 1fr; }
.stack .btn { margin-top: 0.4rem; }
.panel-head .lede { margin: 0; }

.people { width: 100%; border-collapse: collapse; }
.people th {
    text-align: left;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0 0.4rem 0.55rem;
}
.people td {
    padding: 0.75rem 0.4rem;
    border-top: 1px solid var(--line);
    vertical-align: middle;
}
.person { display: flex; align-items: center; gap: 0.75rem; }
.person strong { display: block; font-size: 0.95rem; }
.person > span span { display: block; color: var(--muted); font-size: 0.82rem; }
.pill {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: #f3eee4;
    color: var(--olive);
}
.pill.admin { background: var(--olive); color: var(--cream); }
.row-actions { display: flex; gap: 0.15rem; align-items: center; justify-content: flex-end; white-space: nowrap; }
.row-actions form { margin: 0; }

#pieces, #patterns, #integrations { scroll-margin-top: 84px; }
.shop-downloads { margin: 0; }
.shop-downloads h2 { margin: 0 0 0.4rem; font-size: 1.02rem; }
.shop-downloads ul { margin: 0; padding: 0; list-style: none; }
.shop-downloads li { border-top: 1px solid var(--line); }
.shop-downloads a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.55rem 0.15rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}
.shop-downloads a:hover { color: var(--olive); }
.shop-downloads a .icon-btn {
    border: 1px solid var(--line);
    background: white;
}

body.auth-body { background: var(--paper); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 0.9fr) 1.15fr; }
.auth aside {
    background: var(--olive);
    color: var(--cream);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1.2rem;
    padding: 2.4rem;
}
.auth aside img { width: 96px; height: 96px; border-radius: 24px; object-fit: cover; }
.auth aside p { margin: 0; max-width: 18rem; font-size: 1.35rem; line-height: 1.35; letter-spacing: -0.02em; }
.auth main { display: grid; place-items: center; padding: 2rem 1.2rem; }
.auth .sheet { width: min(400px, 100%); background: white; border-radius: 20px; padding: 1.6rem 1.5rem 1.4rem; box-shadow: 0 16px 40px rgba(42, 44, 31, 0.06); }
.auth h1 { margin: 0 0 1rem; font-size: 1.55rem; letter-spacing: -0.03em; }

.dash-hello {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.2rem;
}

.dash-when {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dash-hello h2 {
    margin: 0.15rem 0 0.25rem;
    font-size: 1.65rem;
    letter-spacing: -0.03em;
    font-weight: 600;
}

.dash-hello .hint { max-width: 34rem; }

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.85fr);
    gap: 1rem;
    align-items: start;
}

.dash-grid > .panel,
.dash-side .panel { margin-bottom: 0; }

.dash-side { display: flex; flex-direction: column; gap: 1rem; }

.dash-more { color: var(--rose); font-size: 0.84rem; text-decoration: none; white-space: nowrap; }
.dash-more:hover { color: var(--olive); }

.dash-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.dash-piece {
    display: block;
    color: inherit;
    text-decoration: none;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.4rem 0.4rem 0.55rem;
}

.dash-piece:hover { background: #faf8f3; }

.dash-piece img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: radial-gradient(ellipse at 50% 42%, hsl(40 34% 95%), hsl(36 18% 84%));
    display: block;
}

.dash-piece strong { display: block; margin: 0.45rem 0.3rem 0; font-size: 0.92rem; }
.dash-piece span { display: block; margin: 0.12rem 0.3rem 0; color: var(--muted); font-size: 0.78rem; }

.meter {
    height: 8px;
    margin: 0.75rem 0 0.35rem;
    border-radius: 99px;
    background: #f3eee4;
    overflow: hidden;
}

.meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--olive);
}

.meter-label { margin: 0; color: var(--muted); font-size: 0.82rem; }

.swatches {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.swatches a { color: inherit; text-decoration: none; font-size: 0.78rem; }
.swatches img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    margin-bottom: 0.28rem;
    background: #faf8f3;
}
.swatches strong { display: block; font-weight: 500; }

.dash-list { list-style: none; margin: 0.35rem 0 0; padding: 0; }
.dash-list a {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    padding: 0.5rem 0.05rem;
    border-top: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}
.dash-list a:hover { color: var(--olive); }
.dash-list span { color: var(--muted); font-size: 0.8rem; }

.stat:hover { box-shadow: 0 14px 30px rgba(42, 44, 31, 0.08); }

@media (max-width: 980px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .workspace, .profile-layout, .dash-grid, .studio-settings { grid-template-columns: 1fr; }
    .dash-hello { flex-direction: column; align-items: flex-start; }
    .studio-hero { flex-wrap: wrap; }
    .studio-hero-actions { margin-left: 0; width: 100%; }
    .studio-hero-actions .btn,
    .studio-hero-actions form { width: 100%; }
    .studio-hero-actions .btn { justify-content: center; }
    .studio-inline-form { grid-template-columns: 1fr; }
    .studio-person {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "avatar copy actions"
            "avatar role actions";
    }
    .studio-person .avatar { grid-area: avatar; }
    .studio-person-copy { grid-area: copy; }
    .studio-person .pill { grid-area: role; justify-self: start; }
    .studio-person .row-actions { grid-area: actions; }
}

@media (max-width: 760px) {
    .side { transform: translateX(-105%); transition: transform 0.2s ease; }
    body.nav-open .side { transform: none; }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(42, 44, 31, 0.42); z-index: 30; }
    .maincol { margin-left: 0; }
    .icon-btn.nav-toggle { display: grid; }
    .who { display: none; }
    .studio-switch-copy { display: none; }
    .studio-switch-btn { padding-right: 0.28rem; }
    .stats { grid-template-columns: 1fr; }
    .fields.two, .studio-pick { grid-template-columns: 1fr; }
    .studio-logo-preview { align-items: flex-start; }
    .studio-card {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .studio-card-actions {
        width: 100%;
        justify-content: stretch;
    }
    .studio-card-actions .btn,
    .studio-card-actions form { flex: 1; }
    .studio-card-actions .btn { justify-content: center; width: 100%; }
    .content { padding: 1rem; }
    .auth { grid-template-columns: 1fr; }
    .auth aside { min-height: 210px; justify-content: flex-end; }
}
