:root {
  color-scheme: dark;
  --bg: #090d0f; --surface: #101719; --card: #121a1d; --line: #293437;
  --text: #f0f4f3; --muted: #a8b4b5; --accent: #9de7e5; --faint: #849294;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font: 16px/1.48 Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg); scroll-behavior: smooth;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body, figure, p, h1, h2, h3 { margin: 0 }
body { min-width: 0 }
button, input, select, textarea, a { font: inherit }
button, a { -webkit-tap-highlight-color: transparent }
button { cursor: pointer; background: transparent; color: inherit; border: 0 }
button:disabled { opacity: .48; cursor: default }
a { color: inherit; text-decoration: none }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px }
h1, h2, h3 { line-height: 1.1; font-weight: 550; letter-spacing: -.045em; text-wrap: balance }
h1 { font-size: clamp(2.35rem, 4vw, 3.5rem); margin: .2em 0 .36em }
h2 { font-size: 1.38rem } h3 { font-size: 1.08rem }
p { overflow-wrap: break-word }
.mast, #entry { width: min(100% - clamp(32px, 7vw, 128px), 1600px); margin-inline: auto }
.mast { display: flex; align-items: center; gap: 30px; min-height: 83px }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 650; letter-spacing: -.055em; line-height: 1 }
.brand-mark { display: flex; align-items: center; gap: 3px; width: 28px; height: 27px; transform: skew(-12deg); color: var(--accent) }
.brand-mark i { display: block; width: 4px; height: 14px; background: currentColor; border-radius: 2px }
.brand-mark i:nth-child(2) { height: 23px }.brand-mark i:nth-child(3) { height: 27px }.brand-mark i:last-child { height: 12px }
.mast-context { color: var(--muted); border-left: 1px solid var(--line); padding-left: 22px; font-size: .85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.top-nav { display: flex; align-items: center; gap: 29px; margin-left: 24px; color: var(--muted); font-size: .9rem }
.top-nav a:hover, .nav-login:hover, .top-nav a:first-child { color: var(--text) }
.mast-actions { margin-left: auto; display: flex; align-items: center; gap: 18px }
.nav-login { color: var(--muted); font-size: .88rem; padding: 9px }
.nav-register { background: #e6ecea; color: #0a1011; border-radius: 6px; padding: 9px 15px; font-weight: 600; font-size: .88rem; display: flex; gap: 14px; align-items: center }
.nav-register:hover { background: white }.nav-register, .hero-actions .primary { white-space: nowrap }.mast > .link { margin-left: auto; flex-shrink: 0 }
#entry { padding: 4px 0 clamp(25px, 5vw, 76px) }
.showcase { height: clamp(440px, 39vw, 610px); position: relative; isolation: isolate; overflow: hidden; border: 1px solid #37464a; border-radius: 13px; background: #0a1418 url('/avatar-generator/plattform/studio.webp') center / cover no-repeat; scroll-margin-top: 8px }
.hero-scrim, .hero-picture { position: absolute; inset: 0; pointer-events: none }
.hero-picture { z-index: -3; left: 34%; display: flex; justify-content: center; align-items: flex-start }
.portrait-view { position: relative; overflow: hidden; isolation: isolate; background: #0c1518; aspect-ratio: 1 }
.portrait-view img, .portrait-view canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22% }
.portrait-view canvas { z-index: 1 }
.portrait-view[data-full-portrait] { aspect-ratio:3/4 }
.portrait-view[data-full-portrait] #performance-portrait {
  inset:var(--performance-top,0%) auto auto var(--performance-left,0%);
  width:var(--performance-width,100%);height:var(--performance-height,100%);object-fit:fill
}
.stage .portrait-view[data-full-portrait], .hero-picture .portrait-view[data-full-portrait] {
  width:min(100%,46.5vh);height:auto;max-height:none;top:0;margin-inline:auto;mask-image:none
}
.preview-img:has(img[data-full-portrait]) {aspect-ratio:3/4;height:auto}
.hero-picture .portrait-view { flex: none; height: 118%; max-width: 115%; top: 0; mask-image: linear-gradient(90deg, transparent, #000 15%, #000 83%, transparent) }
.hero-picture > .idle-layer { width: auto; height: 100%; max-width: 100%; object-fit: contain }
.hero-picture:has(> .idle-layer:not([hidden])) .portrait-view { display: none }
.hero-scrim { z-index: -1; background: linear-gradient(90deg, #060c0ff2, #070e12cd 20%, #07101551 49%, transparent 68%), linear-gradient(0deg, #050b0eac, transparent 35%); }
.hero-top, .hero-copy, .hero-indicator { position: absolute; --edge: clamp(24px, 3.5vw, 60px) }
.hero-top { top: clamp(22px, 2.5vw, 39px); inset-inline: var(--edge); display: flex; justify-content: space-between; align-items: center; }
.camera-label, .counter, .hero-indicator, .eyebrow, .side-label, .badge { font: 600 .67rem/1.35 var(--mono); text-transform: uppercase; letter-spacing: .15em }
.camera-label, .hero-indicator, .eyebrow { display: inline-flex; align-items: center; gap: 9px }
.camera-label { color: #ecf3f1 }
.focus-mark { width: 15px; height: 15px; display: inline-block; background: linear-gradient(var(--accent),var(--accent)) top left/5px 1px,linear-gradient(var(--accent),var(--accent)) top left/1px 5px,linear-gradient(var(--accent),var(--accent)) top right/5px 1px,linear-gradient(var(--accent),var(--accent)) top right/1px 5px,linear-gradient(var(--accent),var(--accent)) bottom left/5px 1px,linear-gradient(var(--accent),var(--accent)) bottom left/1px 5px,linear-gradient(var(--accent),var(--accent)) bottom right/5px 1px,linear-gradient(var(--accent),var(--accent)) bottom right/1px 5px; background-repeat: no-repeat }
.counter { color: #d2dcdb; font-weight: 450 }
.hero-copy { left: var(--edge); bottom: clamp(32px, 4.1vw, 72px); max-width: 44% }
.hero-copy :is(h1, h2) { font-size: clamp(4rem, 6.9vw, 7.9rem); line-height: .97; font-weight: 470; letter-spacing: -.07em; margin: 0 0 .17em; color: #fafbf8 }
.hero-copy > p:not(.hero-note) { color: #c9d3d3; max-width: 29ch; font-size: clamp(.96rem, 1.2vw, 1.22rem); line-height: 1.45; }
.hero-actions, .audition { display: flex; align-items: center }
.hero-actions { gap: 10px; margin-top: 12px; flex-wrap: wrap }
.hero-copy .hero-role { display: block; color: #c9d3d3; font-size: .78rem; margin-top: 16px; max-width: 240px }
.hero-role select { display: block; margin: 4px 0 0; padding: 6px 10px; min-height: 34px; width: 100%; background: #111b1edd }
.hero-copy > .audition { margin-top: 10px; min-height: 32px }
#use-avatar { margin-top: 16px }
.primary, .secondary, a.secondary { display: inline-flex; gap: 12px; align-items: center; justify-content: center; min-height: 44px; padding: .66rem 1rem; border-radius: 6px; font-size: .9rem; font-weight: 590; text-decoration: none }
.primary { color: #0b191b; background: var(--accent); border: 1px solid transparent }
.primary:hover:enabled { background: #b7f4ef }
.primary span { font-size: 1.1rem; line-height: 1 }
.secondary, a.secondary { border: 1px solid #344449; background: #172125; color: var(--text) }
.secondary:hover:enabled, a.secondary:hover { background: #223034; border-color: #516267 }
.audition { gap: 9px; color: #eff5f3; padding: 9px 0; font-weight: 550; font-size: .9rem; white-space: nowrap }
.play-icon { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid #7c9092; border-radius: 50% }
.play-icon::after { content: ""; width: 0; height: 0; border-block: 4px solid transparent; border-left: 6px solid #eff5f3; margin-left: 2px }
.audition[aria-pressed=true] .play-icon::after { width: 7px; height: 7px; border: 0; margin: 0; background: currentColor }
.hero-note { color: #d3e6e7; font: .76rem/1.3 var(--mono); position: absolute; top: 100%; margin-top: 6px }
.hero-indicator { right: var(--edge); bottom: 28px; color: #d0dcde; gap: 7px; font-size: .62rem }
.hero-indicator i, .side-foot i, .eyebrow i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--accent) }
.gallery-row { display: flex; align-items: center; gap: clamp(16px, 2.3vw, 40px); padding: 23px 1px; border-bottom: 1px solid var(--line) }
.gallery-title { font-size: .88rem; color: #c5d0d0; white-space: nowrap }
.gallery-faces { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; flex: 1 }
.gallery-face { display: flex; align-items: center; min-width: 0; gap: 11px; padding: 6px 15px 6px 6px; border: 1px solid var(--line); border-radius: 8px; text-align: left; background: #101719 }
.gallery-face[aria-pressed=true] { border-color: #84bdbd; background: #172325 }
.gallery-face:hover, .face-pick:hover, .app-card:hover { border-color: #617477 }
.gallery-face img { width: 40px; height: 43px; object-fit: cover; object-position: center 25%; border-radius: 4px }
.gallery-face strong, .gallery-face small { display: block }
.gallery-face strong { font-weight: 570; line-height: 1.3; font-size: .89rem }
.gallery-face small { color: var(--muted); font-size: .68rem; white-space: nowrap }
.gallery-arrows { display: flex; gap: 7px }
.gallery-arrows button, .icon-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; line-height: 1 }
.gallery-arrows button:hover, .icon-close:hover { border-color: var(--accent) }
.public-apps { margin-top: clamp(25px, 3.2vw, 50px); scroll-margin-top: 18px }
.public-apps h2 { margin: 0 0 16px; font-size: clamp(1.45rem, 2.3vw, 2.1rem) }
.public-families { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px }
.public-families article { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 19px 22px }
.public-families h3 { color: #d8e6e5; margin: 0 0 9px; font-size: 1.13rem }
.public-families button { display: inline-flex; align-items: center; color: var(--muted); padding: 4px 0; margin-right: 18px; font-size: .86rem }
.public-families button::after { content: '↗'; color: var(--accent); margin-left: 5px }
.public-families button:hover { color: var(--text); text-decoration: underline }
.concept-link { margin-top: 20px; color: var(--muted); font-size: .76rem }
.concept-link a { border-bottom: 1px solid #526365 }
.generator-form { max-width: 600px }
.avatar-drafts { max-width: 800px }
.avatar-draft { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 16px; border-top: 1px solid var(--line) }
.avatar-draft:first-child { border-top: 0 }
.avatar-draft > img { display: block; width: 72px; height: 96px; object-fit: contain; background: #080c0e; border-radius: 5px }
.avatar-draft-info { min-width: 0 }
.avatar-draft h3 { margin: 0 0 6px; font-size: 1rem; overflow-wrap: anywhere }
.avatar-draft p { margin: 4px 0 }
.draft-status { color: var(--accent); font-size: .78rem }
.avatar-draft .danger-link { color: #e6aa9f; font-size: .8rem; text-align: left }
.avatar-draft .danger-link:hover { color: #ffd0c5 }
@media(max-width: 520px){.avatar-draft { grid-template-columns: 60px minmax(0,1fr); gap: 10px 14px; padding: 14px }.avatar-draft > img { width: 60px; height: 80px; grid-row: span 2 }.avatar-draft .danger-link { grid-column: 2 }}
.avatar-video-composer { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px }
.avatar-video-composer summary { cursor: pointer; color: var(--accent); font-size: .86rem }
.avatar-video-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; margin-top: 12px }
.avatar-video-controls textarea, .avatar-video-controls input { width: 100% }
.avatar-video-controls .audio-input { align-self: center }
.avatar-video-jobs { display: grid; gap: 10px; margin-top: 12px }
.avatar-video-job { border: 1px solid var(--line); border-radius: 6px; padding: 10px }
.avatar-video-job video { display: block; width: min(100%,420px); margin-top: 9px; background: #050708 }
.auth { background: #101719; color: var(--text); width: min(430px, calc(100% - 28px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid #425055; border-radius: 13px; padding: clamp(22px, 3vw, 32px); box-shadow: 0 24px 100px #0009 }
.auth::backdrop { background: #03070bd1; backdrop-filter: blur(7px) }
.auth-header, .dialog-head, .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.auth-header .camera-label { color: var(--accent) }.icon-close { font-size: 1.25rem; width: 30px; height: 30px; color: var(--muted) }
.auth h2 { font-size: 2.05rem; margin: 24px 0 17px }
.tabs { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 18px; background: var(--bg) }
.tabs button { flex: 1; padding: 8px 3px; color: var(--muted); font-size: .85rem; border-radius: 4px }
.tabs button[aria-pressed=true] { background: #243034; color: var(--text) }
.wide { width: 100% }.error { color: #ffb5a5; font-size: .88rem; margin-top: .65rem }.error:empty { display: none }
label, legend { display: block; color: #d6dfdf; font-size: .86rem; font-weight: 560 }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; background: #0c1214; color: var(--text); border: 1px solid #3a484c; border-radius: 6px; padding: .63rem .75rem; margin: .32rem 0 .9rem; min-height: 42px }
input::placeholder, textarea::placeholder { color: #91a0a2 }textarea { resize: vertical }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0 .6rem 0 0 }
fieldset { border: 0; padding: 0; margin: .6rem 0 1.1rem }.check { display: flex; align-items: center; font-weight: 450; margin: .45rem 0 }
.auth .muted { font-size: .8rem; margin: 0 0 15px }
.muted, .small, .intro, small { color: var(--muted) }.small, small { font-size: .8rem }
.intro { margin: .5rem 0 1.7rem; max-width: 65ch }.eyebrow, .side-label { color: var(--accent) }
.link { color: var(--accent); padding: .35rem 0; font-size: .86rem }.link:hover { text-decoration: underline; text-underline-offset: 3px }
#shell { display: grid; grid-template-columns: clamp(175px, 16vw, 230px) minmax(0,1fr); border-top: 1px solid var(--line); min-height: calc(100dvh - 83px) }
.sidebar { border-right: 1px solid var(--line); background: #0d1214; display: flex; flex-direction: column; padding: 27px 16px }
.sidebar select { margin-bottom: 24px; font-size: .84rem }.side-label { font-size: .63rem }
.sidebar nav { display: grid; gap: 4px }.sidebar nav :is(button, a) { border-radius: 5px; padding: .68rem .6rem; text-align: left; color: var(--muted); font-size: .85rem }
.sidebar nav :is(button, a) span { display: inline-block; width: 22px }.sidebar nav [aria-current=page] { background: #1c2c2f; color: #b8eae6 }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .73rem; overflow-wrap: anywhere; padding-top: 25px }.side-foot i { flex: none }
#work { width: 100%; max-width: 1480px; margin-inline: auto; padding: clamp(22px, 3vw, 55px) }
.section-title { margin-bottom: 12px }.section-title h2 { font-size: 1.14rem } .second { margin-top: 24px }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0 }
.panel-in, .preview-bottom, .dialog-panel, .tools { padding: clamp(16px, 1.7vw, 27px) }
.setup-grid { display: grid; grid-template-columns: 1.37fr minmax(225px,.9fr); align-items: start; gap: clamp(16px, 2.4vw, 40px); margin-top: 26px }
.family-list { display: grid; gap: 15px }.family-group h3 { color: var(--muted); font-size: .81rem; letter-spacing: .015em; margin-bottom: 7px }
.app-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px }
.app-card, .face-pick { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; text-align: left }
.app-card { padding: 14px; min-height: 112px }.app-card[aria-pressed=true], .face-pick[aria-pressed=true] { background: #17272a; border-color: #83b5b5 }
.cat { color: var(--accent); font: .64rem var(--mono); text-transform: uppercase; letter-spacing: .08em }.app-card strong { display: block; font-size: 1rem; line-height: 1.18; margin: 7px 0; overflow-wrap: anywhere; hyphens: auto }
.desc { display: block; color: var(--muted); font-size: .83rem; line-height: 1.35 }
.face-picks { display: flex; flex-wrap: wrap; gap: 7px }.face-pick { padding: 5px 10px 5px 5px; display: flex; align-items: center; gap: 7px; font-size: .83rem }
.section-actions{display:flex;align-items:center;gap:14px}.danger-link{border:0;background:none;color:#9a4337;text-decoration:underline;text-underline-offset:3px;cursor:pointer;font:inherit;padding:0}.danger-link:hover{color:#742c23}.danger-link[hidden]{display:none}
.forgot-link{display:block;border:0;background:none;color:var(--muted);text-decoration:underline;text-underline-offset:3px;padding:0;margin:-4px 0 16px auto;cursor:pointer;font:inherit;font-size:.86rem}
.face-pick img { width: 35px; height: 40px; object-fit: cover; object-position: center 22%; border-radius: 3px }
.preview { overflow: hidden }.preview-img { position: relative; aspect-ratio: 1.48; background: #0c1417; overflow: hidden }
.preview-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 22% }.badge { position: absolute; top: 12px; left: 12px; background: #0a1214cf; color: #dce9e8; padding: 5px 7px; border-radius: 3px; font-size: .59rem }
.preview-bottom h2, .panel-in h2 { margin: 5px 0 9px }.preview-bottom p, .panel-in>p, .tools>p { margin: .48rem 0 .86rem }.preview-bottom .small { margin: .62rem 0 0 }.preview-bottom .primary { justify-content: space-between }
.row { border-top: 1px solid var(--line); padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: .88rem }.row:first-child { border: 0 }.row small, .member small { display: block }.empty { color: var(--muted); padding: .85rem 1rem; font-size: .86rem }
.room-grid { display: grid; grid-template-columns: minmax(0,1.16fr) minmax(0,1fr); align-items: start; gap: 18px; margin-top: 20px }
.stage-panel { overflow: hidden }.stage .portrait-view { width: 100%; max-height: 62vh }
.dialog-head .eyebrow { color: #c8d6d5 }.pill { background: #1a2c2e; color: #bde5e1; padding: 4px 9px; font-size: .73rem; border-radius: 4px }
.history { min-height: 150px; max-height: 44vh; overflow-y: auto; scrollbar-gutter: stable; padding: .75rem 0 }
.bubble { white-space: pre-wrap; overflow-wrap: anywhere; width: fit-content; max-width: 94%; margin: .4rem 0; padding: .65rem .85rem; background: #1d292c; border-radius: 7px; font-size: .92rem }
.bubble.me { margin-left: auto; background: #163034 }.bubble b { display: block; color: var(--accent); font-size: .72rem; margin-bottom: 3px }.bubble small { display: block }
.tools { margin: 12px 0 }.tools form { display: flex; align-items: end; gap: 8px; margin: .65rem 0 }.tools label { flex: 1; min-width: 0 }.tools input { margin-bottom: 0 }
.tool-output, details { border-top: 1px solid var(--line); padding: .65rem 0 }.tool-output p, details p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .35rem 0 }summary { cursor: pointer }
.notice { padding: .7rem 1rem; border: 1px solid #415a5b; background: #162728; border-radius: 6px; margin-bottom: 1rem }.notice.bad { background: #352620; color: #ffd5c4 }
.admin-grid, .metric-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; margin: 1.3rem 0 }.metric-grid strong { font-size: 2.1rem }.compact { max-width: 320px }
.member { border-top: 1px solid var(--line); padding: .7rem 0; overflow-wrap: anywhere }.member:first-child { border: 0 }.code { font: .86rem var(--mono); background: #172629; padding: .6rem; overflow-wrap: anywhere; user-select: all }
.table-wrap { overflow-x: auto }table { width: 100%; border-collapse: collapse; font-size: .84rem }td, th { padding: .55rem .35rem; border-bottom: 1px solid var(--line); text-align: left }#bill-rows :is(th,td):nth-child(n+2) { text-align: right }
@media(max-width: 900px){
  .mast { min-height: 68px; gap: 14px }.top-nav { margin-left: 12px; gap: 16px }.gallery-title { display: none }
  .hero-copy { max-width: 48% }.gallery-face { padding-right: 10px }.room-grid { grid-template-columns: minmax(0,.92fr) minmax(0,1fr) }
  #shell { grid-template-columns: 160px minmax(0,1fr) }.sidebar { padding-inline: 11px }.setup-grid { grid-template-columns: 1.3fr minmax(180px,.8fr); gap: 12px }
}
@media(max-width: 700px){
  .mast, #entry { width: calc(100% - 32px) }.mast { min-height: 62px }.top-nav { display: none }.brand { font-size: 22px }.mast-actions { gap: 4px }.nav-register, .nav-login { font-size: .8rem }.nav-register { gap: 6px; padding: 8px 10px }
  .showcase { height: clamp(485px, 69dvh, 650px) }.hero-picture { left: 0; justify-content: center }.hero-picture .portrait-view { height: auto; width: min(114%, 555px); top: 1%; }
  .hero-scrim { background: linear-gradient(0deg, #050c10 0%, #050c10ec 14%, #050c10a0 32%, transparent 64%), linear-gradient(180deg, #07101266, transparent 15%) }
  .hero-copy { left: 22px; bottom: 31px; max-width: calc(100% - 44px) }.hero-copy :is(h1, h2) { font-size: clamp(3.5rem, 11vw, 5rem) }.hero-copy > p:not(.hero-note) { max-width: 35ch; font-size: .9rem }.hero-actions { margin-top: 16px; gap: 18px }
  .hero-top { inset-inline: 19px; top: 19px }.hero-indicator { display: none }.hero-note { margin-top: 4px; font-size: .67rem }
  .gallery-row { padding: 12px 0 16px }.gallery-faces { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px }.gallery-arrows { display: none }
  .gallery-face { padding: 5px; gap: 6px; justify-content: flex-start }.gallery-face img { width: 31px; height: 34px }.gallery-face strong { font-size: .76rem }.gallery-face small { display: none }
  .public-families { grid-template-columns: 1fr; gap: 8px }.public-families article { padding: 15px 17px }.public-apps { margin-top: 23px }
  #shell { display: block }.sidebar { padding: 9px 16px; border: 0; border-bottom: 1px solid var(--line) }.sidebar .side-label, .side-foot { display: none }.sidebar select { width: auto; max-width: 100%; min-height: 32px; padding: 3px 7px; margin: 0 0 6px }.sidebar nav { display: flex; gap: 4px; overflow-x: auto }.sidebar nav :is(button, a) { white-space: nowrap; padding: 6px; font-size: .76rem }.sidebar nav span { display: none!important }
  #work { padding: 21px 16px 45px }.setup-grid, .room-grid, .admin-grid { grid-template-columns: 1fr }.preview { display: grid; grid-template-columns: minmax(0,.63fr) minmax(0,1fr) }.preview-img { aspect-ratio: auto; height: 100% }
  .stage .portrait-view { max-height: 52vh }.stage-panel .panel-in { padding: 13px 16px }.stage-panel h2,.stage-panel p { margin: .25rem 0 .55rem }.history { max-height: 47vh }.actions { flex-wrap: wrap }.metric-grid { gap: 8px }
}
@media(max-width: 370px){.brand-mark { display: none }.hero-actions { gap: 9px }.hero-actions .primary { font-size: .8rem; padding-inline: 10px }.gallery-face img { width: 25px }.gallery-face strong { font-size: .71rem }}
@media(prefers-reduced-motion: reduce){:root { scroll-behavior: auto }}

.hero-picture .portrait-view[data-cutout] { width: auto; height: 100%; max-width: 100%; top: 0; mask-image: none }
.showcase:has(.portrait-view[data-cutout], .idle-layer:not([hidden])) .hero-scrim { background: linear-gradient(90deg, #05101480, transparent 60%) }
.gallery-face img[data-cutout], .face-pick img[data-cutout] { width: auto; aspect-ratio: 3 / 4; object-fit: contain; object-position: center }
.preview-img:has(img[data-cutout]) { aspect-ratio: 3 / 4; height: auto; align-self: center; background: transparent }
.preview-img img[data-cutout] { height: auto; object-fit: contain }
.stage .portrait-view[data-cutout] { width: min(100%, calc(62vh * var(--cutout-ratio))); max-height: none; margin-inline: auto }
@media(max-width: 700px) {
  .showcase:has(.portrait-view[data-cutout], .idle-layer:not([hidden])) { height: auto; padding: 46px 20px 26px }
  .hero-picture:has(.portrait-view[data-cutout], .idle-layer:not([hidden])) { position: relative; inset: auto; height: clamp(220px, 36svh, 340px) }
  .showcase:has(.portrait-view[data-cutout], .idle-layer:not([hidden])) .hero-copy { position: relative; inset: auto; max-width: none; margin-top: 15px }
  .stage .portrait-view[data-cutout] { width: min(100%, calc(52vh * var(--cutout-ratio))) }
}

/* A profile may supply a location behind its existing transparent portrait. */
.showcase[data-scene], #room-stage[data-scene], #overview .preview-img[data-scene] {
  background: #101518 var(--scene-image) center / cover no-repeat;
}

#room-listening { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; z-index:2 }
.portrait-view:has(#room-listening:not([hidden])) > :is(img,canvas) { visibility:hidden }

#preview-listening { position:absolute; inset:0; width:100%; height:100%; object-fit:contain }
.preview-img:has(#preview-listening:not([hidden])) #preview-poster { visibility:hidden }
/* Clip only the aligned camera, before it is composited into the studio. */
#room-camera { display:contents }
#room-camera[data-inset] { display:block; overflow:hidden; width:min(100%,calc(62vh * .75)); margin-inline:auto }
#room-camera[data-inset] > .portrait-view { width:100%; transform-origin:top left; transform:var(--studio-camera) }
@media (max-width: 700px) {
  #room-camera[data-inset] { width:min(100%,calc(52vh * .75)) }
}

.avatar-draft-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 9px }
.candidate-review { width: min(720px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: clamp(16px, 3vw, 28px); border: 1px solid #425055; border-radius: 13px; background: var(--surface); color: var(--text) }
.candidate-review::backdrop { background: #03070bd9 }
.candidate-review h2 { margin: 18px 0 12px; overflow-wrap: anywhere }
.candidate-warning { border-left: 3px solid #e7c78c; background: #332c20; padding: 11px 13px; color: #f4deb7; font-size: .87rem }
.candidate-stage { display: grid; place-items: center; min-height: 180px; margin: 16px 0; background: #080c0e; border-radius: 7px; overflow: hidden }
.candidate-stage canvas { display: block; max-width: 100%; width: auto; height: auto; max-height: min(48vh, 480px); object-fit: contain }
.candidate-stage p { padding: 24px; text-align: center; color: var(--muted) }
.candidate-review .actions { justify-content: flex-start; flex-wrap: wrap; margin: 16px 0 10px }
#candidate-status { min-height: 1.5em; font-size: .87rem }
.candidate-measurements { margin-top: 12px; color: var(--muted); font-size: .8rem }
.candidate-measurements summary { cursor: pointer; margin-bottom: 7px }
@media(max-width: 520px){.avatar-draft-actions { grid-column: 2 }.candidate-review .actions button { flex: 1 }}

.brand img { display: block; width: 116px; height: auto; }
.auth-brand { display: block; width: 92px; height: auto; }
@media (max-width: 700px) { .brand img { width: 101px; } }
@media (max-width: 370px) { .brand img { width: 84px; } }

/* Small public-homepage refinements; the avatar stage and studio keep their styles. */
#entry .hero-actions { gap: 10px; flex-wrap: nowrap; }
#entry .hero-actions .audition {
  min-height: 44px; padding: 9px 13px; gap: 8px;
  border: 1px solid #526365; border-radius: 6px; background: #111b1eaa;
}
#entry .hero-actions .audition:hover:enabled { background: #223034; border-color: var(--accent); }
#entry .hero-actions .play-icon { width: 22px; height: 22px; flex: none; }
#entry .avatar-create {
  display: inline-flex; align-items: center; min-height: 36px;
  margin-top: 6px; padding: 4px 0; color: var(--muted); font-size: .83rem;
  text-decoration: underline; text-underline-offset: 4px;
}
#entry .avatar-create:hover:enabled { color: var(--text); }
#entry .gallery-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px; padding: 18px 0;
}
#entry .gallery-title { grid-column: 1 / -1; }
#entry .gallery-faces {
  display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
  scrollbar-color: #526365 transparent; padding: 4px; margin: -4px;
}
#entry .gallery-face { flex: 1 0 156px; gap: 8px; padding: 7px; min-height: 60px; }
#entry .gallery-face img { width: 32px; height: 42px; flex: none; }
#entry .gallery-face strong { font-size: .85rem; }
#entry .gallery-face small { font-size: .65rem; }
#entry .entry-footer { margin-top: 20px; color: var(--muted); font-size: .76rem; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 20px; }
#entry .legal-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
#entry .entry-footer a { display: inline-flex; align-items: center; min-height: 36px; border: 0; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 700px) {
  #entry .showcase:has(.portrait-view[data-cutout], .idle-layer:not([hidden])) { padding: 44px 20px 16px; }
  #entry .showcase:has(.portrait-view[data-cutout], .idle-layer:not([hidden])) .hero-copy { margin-top: 10px; }
  #entry .hero-actions { margin-top: 10px; gap: 8px; }
  #entry .hero-actions .primary { gap: 8px; padding-inline: 12px; font-size: .85rem; }
  #entry .hero-actions .audition { padding-inline: 10px; font-size: .85rem; }
  #entry .avatar-create { margin-top: 0; min-height: 44px; }
  #entry .gallery-row { grid-template-columns: minmax(0, 1fr); padding: 12px 0; }
  #entry .gallery-face { flex-basis: 140px; min-height: 54px; }
  #entry .gallery-face img { width: 30px; height: 38px; }
  #entry .entry-footer { justify-content: flex-start; }
  #entry .entry-footer a { min-height: 44px; }
  #entry .legal-links { gap: 4px 18px; }
}
@media (max-width: 370px) {
  #entry .hero-actions .primary { font-size: .8rem; padding-inline: 9px; }
  #entry .hero-actions .primary > span { display: none; }
  #entry .hero-actions .audition { font-size: .8rem; padding-inline: 9px; }
  #entry .gallery-face { flex-basis: 130px; }
}
@media (max-width: 370px) {
  .mast:has(#entry-account:not([hidden])) { gap: 6px; }
  .mast #entry-account { gap: 0; }
  .mast #entry-account .nav-login { padding: 8px 6px; font-size: .76rem; min-height: 44px; }
  .mast #entry-account .nav-register { padding: 8px; font-size: .76rem; gap: 0; min-height: 44px; }
  .mast #entry-account .nav-register span { display: none; }
  #entry .showcase:has(.portrait-view[data-cutout], .idle-layer:not([hidden])) { padding-inline: 14px; }
  #entry .hero-copy { left: 14px; max-width: calc(100% - 28px); }
  #entry .hero-actions { gap: 6px; }
  #entry .hero-actions .primary, #entry .hero-actions .audition { padding-inline: 6px; }
  #entry .hero-actions .audition { gap: 6px; }
}

/* Jomri's public character stage. Conversation and rendering styles stay scoped out. */
@font-face {
  font-family: "Jomri Display"; font-style: normal; font-weight: 400 600;
  font-display: swap;
  src: url('/avatar-generator/plattform/fonts/space-grotesk-latin.woff2') format('woff2');
}
#entry .showcase {
  --scene-tone: 157 231 229;
  border-color: #34494b; box-shadow: 0 18px 65px #0003;
}
#entry .stage-light {
  position: absolute; inset: 0 0 0 34%; z-index: -4;
  display: grid; place-items: center; pointer-events: none;
}
#entry .stage-light::before {
  content: ''; position: absolute; inset: 2% -5% -5%;
  background: radial-gradient(ellipse at 50% 48%, rgb(var(--scene-tone) / .19), transparent 65%);
}
#entry .light-arc {
  width: min(96%, 620px); height: auto; overflow: visible;
  color: var(--accent); opacity: .7; transform: translateY(-2%);
  filter: drop-shadow(0 0 8px #9de7e529);
  transition: opacity .3s ease, filter .3s ease;
}
#entry .light-arc .arc-trace { opacity: .12; }
#entry .showcase[data-audition] .light-arc {
  opacity: 1; filter: drop-shadow(0 0 12px #9de7e578);
}
@media (prefers-reduced-motion: no-preference) {
  #entry .showcase[data-audition] .light-arc { animation: jomri-audition-light 2.4s ease-in-out infinite; }
}
@keyframes jomri-audition-light {
  0%, 100% { opacity: .62; }
  50% { opacity: 1; }
}
#entry #hero-camera {
  display: flex; justify-content: center; position: relative;
  flex: none; height: 100%; max-width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(0deg, transparent, #000 17%, #000 96%, transparent);
  mask-composite: intersect;
}
#entry #hero-camera > .portrait-view {
  width: auto; height: 100%; max-width: none; top: 0;
}
#entry #hero-camera > .portrait-view[data-full-portrait] { width: auto; height: 100%; }
#entry .hero-picture:has(> .idle-layer:not([hidden])) #hero-camera { display: none; }
#entry .hero-picture > .idle-layer { mask-image: linear-gradient(0deg, transparent, #000 15%, #000 97%, transparent); }
#entry .hero-copy :is(h1, h2) {
  font-family: "Jomri Display", Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(3.8rem, 7.2vw, 7.5rem); font-weight: 500;
  letter-spacing: -.065em; line-height: 1; margin-bottom: .2em;
}
#entry .hero-copy > p:not(.hero-note) { max-width: 31ch; }
#entry .hero-actions .primary { box-shadow: 0 3px 20px #9de7e512; }
#entry .hero-actions .primary:hover:enabled { box-shadow: 0 3px 24px #9de7e52b; }
#entry .hero-actions .primary, #entry .hero-actions .audition {
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
#entry .gallery-row { padding-block: 16px; }
#entry .gallery-face {
  position: relative; flex-basis: 156px; min-height: 76px; padding: 8px;
  border-color: transparent; border-radius: 9px; background: #10171975;
  transition: border-color .2s ease, background-color .2s ease;
}
#entry .gallery-face[aria-pressed=true] {
  background: linear-gradient(125deg, #9de7e51c, #9de7e506);
  border-color: #9de7e540;
}
#entry .gallery-face[aria-pressed=true]::after {
  content: ''; position: absolute; bottom: 0; left: 18px; right: 18px;
  height: 2px; border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 11px #9de7e55c;
}
#entry .gallery-face:hover { background-color: #1b292c; }
#entry .gallery-portrait {
  display: block; flex: none; width: 42px; height: 54px;
  overflow: hidden; border-radius: 6px;
  background: radial-gradient(ellipse at center, #34494a66, transparent 75%);
}
#entry .gallery-face .gallery-portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 22%;
  transform: scale(1.16); transform-origin: center 30%; border-radius: 0;
}
#entry .gallery-face > span:last-child { min-width: 0; }
#entry .gallery-face strong { font-weight: 600; }
#entry .gallery-face small { white-space: normal; line-height: 1.3; margin-top: 3px; }
#entry .public-apps h2 {
  font-family: "Jomri Display", Inter, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500; font-size: clamp(1.45rem, 2.15vw, 1.9rem); letter-spacing: -.04em;
}
#entry .public-families article { background: #10171980; border-color: #273638; }
@media (max-width: 900px) {
  #entry .hero-copy :is(h1, h2) { font-size: clamp(3.2rem, 7.2vw, 5.1rem); }
}
@media (max-width: 700px) {
  #entry .showcase { background-position: center; }
  #entry .showcase .hero-scrim { background: linear-gradient(0deg, #061013ed, #06101390 32%, transparent 67%); }
  #entry .stage-light { inset: 40px 0 auto; height: clamp(220px, 36svh, 340px); }
  #entry .light-arc { width: min(100%, 360px); max-height: 115%; transform: translateY(-4%); }
  #entry .stage-light::before { inset: -10% -10% -15%; }
  #entry #hero-camera { height: 100%; }
  #entry .hero-copy :is(h1, h2) { font-size: clamp(2.8rem, 12vw, 4.5rem); letter-spacing: -.06em; }
  #entry .gallery-row { padding-block: 12px; }
  #entry .gallery-face { min-height: 68px; flex-basis: 136px; gap: 8px; }
  #entry .gallery-portrait { width: 38px; height: 48px; }
  #entry .gallery-face strong { font-size: .83rem; }
}
@media (prefers-reduced-motion: reduce) {
  #entry .light-arc, #entry .gallery-face, #entry .hero-actions > button { animation: none; transition: none; }
}

#avatar-video-page .generator-form { max-width: 46rem; }
#video-composer .avatar-video-controls { grid-template-columns: minmax(0,1fr); }
#video-composer button { justify-self: start; }
#video-composer video { display: block; max-width: 100%; height: auto; }
#video-avatar, #video-wav { max-width: 100%; min-width: 0; }

#video-composer .video-confirm { display: flex; align-items: flex-start; gap: .7rem; }
#video-composer .video-confirm input { width: auto; margin-top: .3rem; }
#video-composer blockquote { margin: .6rem 0 1rem; padding-left: .8rem; border-left: 2px solid var(--line); overflow-wrap: anywhere; }
#video-composer .video-source { margin-top: 1rem; }

/* Preserve the square renderer surface. Stretching it into the 3:4 studio
   frame changes the avatar's face and body proportions. */
.portrait-view #fullportrait-portrait {
  inset:50% auto auto 50%;
  width:100%;
  height:auto;
  aspect-ratio:1/1;
  object-fit:contain;
  transform:translate(-50%,-50%);
}
.portrait-view #fullportrait-portrait[hidden] { display:none }
