/* Editorial media cards and retained collection/idea dialogs. */
#trends-grid{display:block}
.editorial-section{margin:8px 0 29px;min-width:0}
.editorial-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
.editorial-section-head h2{font-size:23px;font-weight:650;line-height:1.15;letter-spacing:-.55px}
.editorial-section-head p{font-size:12px;color:#929292;margin-top:6px}
.editorial-all{display:flex;align-items:center;gap:4px;min-height:44px;flex-shrink:0;padding:7px 0 7px 8px;font-size:12px;color:var(--editorial-accent)}
.editorial-all svg{width:16px;height:16px}
.editorial-rail{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none;padding:0 0 5px;overscroll-behavior-x:contain;touch-action:pan-x pan-y}
.editorial-rail::-webkit-scrollbar{display:none}
.editorial-card{position:relative;isolation:isolate;flex:0 0 180px;min-width:0;display:flex;flex-direction:column;align-items:stretch;scroll-snap-align:start;text-align:left;padding:0;background:none;border:0;white-space:normal}
.editorial-open{display:flex;flex-direction:column;align-items:stretch;width:100%;height:100%;padding:0;text-align:left;white-space:normal}
.editorial-art{display:block;position:relative;overflow:hidden;isolation:isolate}
.editorial-art:after{content:'';position:absolute;inset:60% 0 0;background:linear-gradient(transparent,#0008);z-index:1;pointer-events:none}
.editorial-art>img,.editorial-art>video{width:100%;height:100%;object-fit:cover;object-position:50% 38%}
.editorial-art>img{display:block;transition:transform .25s}
.editorial-art>img[data-editorial-poster]:not([data-poster-ready]){visibility:hidden}
.editorial-art>video{position:absolute;inset:0;opacity:0;pointer-events:none;transition:opacity .18s}
.editorial-art>video.ready{opacity:1}
@media(hover:hover){.editorial-card:hover .editorial-art>img{transform:scale(1.035)}}
.editorial-sound{position:absolute;left:7px;top:7px;z-index:3;display:grid;place-items:center;width:32px;height:32px;padding:0;border:1px solid #ffffff30;border-radius:50%;color:#fff;background:linear-gradient(140deg,#ffffff22,#ffffff05),#12121225;box-shadow:inset 0 1px 0 #ffffff25,0 2px 7px #0002;backdrop-filter:blur(12px) saturate(1.4);-webkit-backdrop-filter:blur(12px) saturate(1.4)}
.editorial-sound:before{content:'';position:absolute;inset:-5px;border-radius:50%}
.editorial-sound svg{width:15px;height:15px;pointer-events:none;stroke-width:1.7}
.editorial-sound[aria-pressed=true]{background:#f7f2eaeb;color:#191919;border-color:#fff9}
.editorial-views{display:inline-flex;align-items:center;gap:5px;color:#fff;font-size:11px;line-height:1.2;font-variant-numeric:tabular-nums}
.editorial-card-note{font-size:10px;color:#898989;margin-top:5px}
.editorial-rail-wide .editorial-card{flex-basis:215px}
.editorial-concept-tag{position:absolute;bottom:10px;left:10px;color:#ffddaf;font-size:8px;letter-spacing:1.1px;z-index:1}
.editorial-empty{text-align:center;padding:70px 15px}.editorial-empty h2{font-size:20px}.editorial-empty p{color:#999;margin-top:10px}
.editorial-dialog{color:#f7f7f7;background:#181818;border:1px solid #ffffff18;border-radius:22px;padding:22px;max-width:760px;width:calc(100% - 30px);max-height:90dvh;overscroll-behavior:contain}
.editorial-dialog::backdrop{background:#0009;backdrop-filter:blur(8px)}
.editorial-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
.editorial-dialog header h2{font-size:23px;letter-spacing:-.5px;margin-top:6px}
.editorial-dialog [data-editorial-close]{display:grid;place-items:center;min-width:42px;height:42px;border-radius:50%;background:#ffffff0b}
.editorial-eyebrow{font-size:10px;letter-spacing:1.5px;color:var(--editorial-accent)}
.editorial-collection-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 12px}
.editorial-concept-detail{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:center}
.editorial-concept-detail>img{width:100%;border-radius:14px}
.editorial-concept-detail h2{font-size:28px;letter-spacing:-.6px;line-height:1.1}
.editorial-concept-detail p{color:#b6b6b6;font-size:14px;line-height:1.6;margin-top:15px}
.editorial-concept-detail .editorial-concept-status{color:var(--editorial-accent);font-size:12px}
.feed-caption .sora-current-views{margin-top:7px;min-height:0}
.feed-caption .sora-references{pointer-events:auto;margin-top:9px}
body .reference-toggle{position:relative;padding:5px 12px 5px 7px;gap:9px;border:1px solid #ffffff3d;border-radius:18px;background:linear-gradient(150deg,#ffffff28,#ffffff08 50%,#ffffff15),#15151514;box-shadow:inset 0 1px 0 #ffffff40,inset 0 -1px 0 #ffffff0d,0 4px 18px #0001;backdrop-filter:blur(20px) saturate(1.6);-webkit-backdrop-filter:blur(20px) saturate(1.6);text-shadow:0 1px 4px #0004;font-weight:500}
body .reference-toggle[aria-expanded=true]{background:linear-gradient(150deg,#ffffff36,#ffffff0d 60%),#15151522}
.reference-toggle .reference-stack{width:45px;flex-basis:45px}
.reference-toggle>span:not(.reference-stack){gap:5px}
@media(max-width:700px){
 .editorial-card{flex-basis:145px}.editorial-rail{gap:10px}
 .editorial-rail-wide .editorial-card{flex-basis:181px}
 .editorial-all{font-size:11px}
 .editorial-dialog{padding:18px;border-radius:20px}
 .editorial-collection-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .editorial-concept-detail{grid-template-columns:1fr;gap:17px}.editorial-concept-detail>img{max-height:40dvh;object-fit:cover}
 .editorial-concept-detail h2{font-size:25px}
}
@media(prefers-reduced-motion:reduce){.editorial-art>img{transition:none}}
@media(prefers-reduced-transparency:reduce){body .reference-toggle,.editorial-sound{background:#272727;backdrop-filter:none;-webkit-backdrop-filter:none}}

/* Keep the repeat inputs and action in view, including on short phones. */
.create-screen .page-header{position:sticky;top:0;z-index:8;grid-template-columns:minmax(68px,1fr) minmax(0,auto) minmax(68px,1fr);gap:8px;background:var(--bg);padding-top:calc(10px + var(--safe-top));padding-bottom:10px}
.create-back{display:flex;align-items:center;justify-self:start;gap:5px;min-height:44px;padding:0;font-size:12px;white-space:nowrap}
.create-back svg{width:19px;height:19px}
.create-screen .page-header h1{font-size:15px;line-height:1.2}
.create-screen .header-balance{justify-self:end}
.creation-form{min-width:0}
.prompt-actions .upload-button{display:flex;align-items:center;gap:8px;min-height:44px;width:auto;height:auto;border-radius:12px;padding:8px 11px;color:#eee;background:#ffffff0a;font-size:13px}
.upload-button svg{width:19px;height:19px}
.photo-input-actions{min-height:44px;margin-bottom:16px;gap:10px}
.photo-input-actions .upload-button{flex-shrink:0}
.photo-input-actions .attachment-row{min-width:0;flex:1;overflow-x:auto;margin:0;padding:5px 4px;gap:8px}
.photo-input-actions .attachment{width:42px;height:48px;flex:0 0 42px}
.photo-input-actions .attachment img{width:100%;height:100%}
.photo-input-actions .attachment button{width:20px;height:20px;right:-4px;top:-4px}
.photo-input-actions #prompt-hint:empty{display:none}
.creation-actions{position:sticky;bottom:0;z-index:7;margin-top:8px;padding:8px 0 max(12px,var(--safe-bottom));background:var(--bg)}
.creation-actions .create-status{min-height:17px;margin:0 0 9px;color:#aaa;font-size:12px;line-height:1.4;text-align:center;overflow-wrap:anywhere}
.creation-actions .create-status.has-error{color:#ffb6b6}
.creation-actions .generation-submit{display:flex;align-items:center;justify-content:center;gap:14px;width:100%;min-height:50px;height:auto;padding:12px 16px;border-radius:16px;font-size:16px;font-weight:600}
.generation-submit #generation-price{padding-left:14px;border-left:1px solid #0003;font-size:13px;font-weight:400;white-space:nowrap}
#retry-recipe{display:block;margin:0 auto 10px;min-height:36px;padding:5px 12px;text-decoration:underline;text-underline-offset:3px;font-size:12px}
.create-screen[data-repeat=true]{padding-bottom:0}
.create-screen[data-repeat=true] .creation-stage{flex:0 0 auto;min-height:0;padding:4px 0 16px}
.create-screen[data-repeat=true] .remix-reference{flex-direction:row;gap:14px;width:100%;align-items:center;min-width:0}
.create-screen[data-repeat=true] .reference-media{flex:0 0 60px;width:60px;height:80px;border-radius:12px}
.create-screen[data-repeat=true] .reference-media>img{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover}
.create-screen[data-repeat=true] .reference-media>video{object-fit:cover}
.reference-caption{min-width:0}
.reference-caption>span{display:block;margin-bottom:5px;color:#777;font-size:10px}
.create-screen[data-repeat=true] .remix-reference p{max-width:none;text-align:left;font-size:15px;line-height:1.3;color:#eee;overflow-wrap:anywhere}
.create-screen[data-repeat=true] .creation-form{display:flex;flex-direction:column;flex:1 0 auto}
.create-screen[data-repeat=true] .generation-input-hint{font-size:11px;line-height:1.4;margin-bottom:12px}
.create-screen[data-repeat=true] .character-heading{margin-bottom:7px}
.create-screen[data-repeat=true] .characters{height:74px;margin-bottom:10px}
.create-screen[data-repeat=true] .prompt-box{padding:12px;border-radius:18px}
.create-screen[data-repeat=true] .prompt-box textarea{min-height:56px;max-height:100px;line-height:1.4}
.create-screen[data-repeat=true] .creation-footer{padding-top:7px}
.create-screen[data-repeat=true] .creation-actions{margin-top:auto}
.create-screen[data-repeat=true] .photo-input-actions{margin-bottom:10px}
@media(max-width:350px){.create-screen .page-header{gap:5px;grid-template-columns:65px minmax(0,1fr) 58px}.create-screen .page-header h1{font-size:13px}.create-back{font-size:11px;gap:4px}.create-screen .header-balance{font-size:13px}}
@media(max-height:680px){.create-screen[data-repeat=true] .creation-stage{padding-bottom:10px}.create-screen[data-repeat=true] .reference-media{flex-basis:48px;width:48px;height:64px}.create-screen[data-repeat=true] .generation-input-hint{margin-bottom:8px}.create-screen[data-repeat=true] .characters{height:69px;margin-bottom:8px}.create-screen[data-repeat=true] .prompt-box textarea{min-height:44px}.create-screen[data-repeat=true] .creation-footer{padding-top:4px}.creation-actions{padding-top:6px}.creation-actions .create-status{font-size:11px;margin-bottom:6px}}

/* «снято» layout on the existing editorial catalogue and viewer. */
body.editorial-refresh {
  --bg: #151517;
  --surface: #232326;
  --line: #38383c;
  --muted: #b9b7be;
  --editorial-accent: #e0ff59;
  --editorial-text: #faf9f6;
  --designer-width: 620px;
  --designer-edge: 16px;
  --designer-gap: 4px;
  --designer-card-radius: 24px;
  color: var(--editorial-text);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  background: #101012;
}
.editorial-refresh main {
  width: min(100%, var(--designer-width));
  height: var(--tg-viewport-stable-height, 100dvh);
  margin: 0 auto;
  background: var(--bg);
}
.designer-dock {
  position: fixed;
  z-index: 20;
  inset: auto auto calc(16px + var(--safe-bottom)) 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.designer-home, .designer-create {
  display: grid;
  place-items: center;
  width: 92px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  color: #151517;
  background: var(--editorial-text);
  box-shadow: 0 4px 18px #0006;
}
.designer-create svg { width: 26px; height: 26px; stroke-width: 1.7; }
.designer-create { transition: width 240ms ease-out; }
.designer-home { width: 56px; border: 1px solid #ffffff24; color: var(--editorial-text); background: #252527ef; }
.designer-home svg { width: 24px; height: 24px; }
.designer-home:not([hidden]) + .designer-create { width: 56px; }
.editorial-refresh:is([data-screen=create], [data-screen=profile]) .designer-dock { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .designer-home:not([hidden]) { animation: dock-home-in 220ms ease-out both; }
  @keyframes dock-home-in {
    from { opacity: 0; transform: translateX(12px) scale(.9); }
    to { opacity: 1; transform: none; }
  }
}
@media (prefers-reduced-motion: reduce) { .designer-create { transition: none; } }
.editorial-refresh .trends-screen {
  max-width: none;
  padding: 0 var(--designer-gap) calc(92px + var(--safe-bottom));
  scroll-padding-top: 206px;
}
.editorial-refresh .trends-header {
  position: relative;
  margin-inline: calc(-1 * var(--designer-gap));
  padding: calc(16px + var(--safe-top)) var(--designer-edge) 9px;
  background: var(--bg);
  backdrop-filter: none;
}
.trends-brand {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.editorial-refresh .trends-brand h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -.075em;
}
.trends-profile {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  overflow: hidden;
}
.trends-profile svg { width: 21px; height: 21px; }
.trends-profile img { width: 100%; height: 100%; object-fit: cover; }
.trends-profile:has(img:not([hidden])) svg { display: none; }
.editorial-refresh .trends-header .trends-search {
  display: flex;
  gap: 12px;
  height: 52px;
  padding-inline: 17px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}
.editorial-refresh .trends-search input::placeholder { color: var(--muted); }
.editorial-refresh .trends-search:focus-within { border-color: var(--editorial-accent); }
.editorial-refresh .trends-heading { margin: 11px 0 0; padding: 0; }
.editorial-refresh .trend-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px var(--designer-edge);
  height: 50px;
  width: calc(100% + 2 * var(--designer-edge));
  margin-inline: calc(-1 * var(--designer-edge));
  border: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
}
.editorial-refresh .trend-tabs:before { content: none; }
.editorial-refresh .trend-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--editorial-text);
  line-height: 1;
  letter-spacing: 0;
  font-size: 14px;
  white-space: nowrap;
}
.editorial-refresh .trend-tabs button svg { width: 15px; height: 15px; }
.editorial-refresh .trend-tabs button[aria-selected=true] {
  border-color: var(--editorial-text);
  background: var(--editorial-text);
  color: var(--bg);
  font-weight: 650;
}
.editorial-refresh .trend-tabs button[aria-selected=true]:after { display: none; }
.editorial-refresh .trend-tabs button[data-trend-type="hype"]:not([aria-selected=true]) {
  color: var(--editorial-accent);
  border-color: #e0ff5950;
  background: #e0ff5914;
}
.editorial-refresh .trends-grid { padding-top: 0; }
.editorial-refresh #trends-grid.editorial-mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--designer-gap);
  overflow: visible;
  padding-bottom: 0;
}
.editorial-refresh .editorial-mosaic .trend-column {
  display: flex;
  flex-direction: column;
  gap: var(--designer-gap);
  min-width: 0;
}
.editorial-refresh .editorial-mosaic .editorial-card { width: 100%; }
.editorial-refresh .editorial-open { border-radius: var(--designer-card-radius); }
.editorial-refresh .editorial-art {
  width: 100%;
  aspect-ratio: var(--designer-aspect, .625);
  border-radius: var(--designer-card-radius);
  background: var(--surface);
}
.editorial-refresh .editorial-mosaic .editorial-art:after { content: none; }
.editorial-refresh .editorial-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: absolute;
  z-index: 2;
  inset: auto 12px 12px;
  margin: 0;
  font-size: clamp(13px, 2.4vw, 16px);
  line-height: 1.16;
  font-weight: 650;
  color: white;
  text-wrap: pretty;
  text-shadow: 0 1px 8px #000b;
}
.editorial-refresh .editorial-art .editorial-views {
  position: absolute;
  z-index: 2;
  inset: 9px auto auto 9px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #111115c2;
  color: #fff;
  font-size: 10px;
  line-height: 1.15;
}
.editorial-refresh .editorial-mosaic .editorial-card-title,
.editorial-refresh .editorial-mosaic .editorial-card-note,
.editorial-refresh .editorial-mosaic .editorial-concept-tag { display: none; }
.editorial-refresh .editorial-art .editorial-views { inset: auto 7px 6px auto; padding: 3px 6px; font-size: 12px; }
.editorial-refresh .editorial-views svg { width: 12px; height: 12px; }
.editorial-refresh button:focus-visible,
.editorial-refresh a:focus-visible,
.editorial-refresh textarea:focus-visible {
  outline: 2px solid var(--editorial-accent);
  outline-offset: 3px;
}
.editorial-refresh :is(.editorial-open, .trend-tabs button):focus-visible { outline-offset: -3px; }
.editorial-refresh .feed-screen { padding: 0; }
.editorial-refresh[data-screen=feed] {
  --viewer-height: min(100dvh, var(--tg-viewport-height, 100dvh), var(--tg-viewport-stable-height, 100dvh));
}
.editorial-refresh[data-screen=feed] main { height: var(--viewer-height); }
.editorial-refresh[data-screen=feed] .designer-dock {
  bottom: calc(100dvh - var(--viewer-height) + 16px + var(--safe-bottom));
}
.editorial-refresh .feed-frame {
  --repeat-space: 0px;
  width: 100%;
  min-width: 0;
  max-width: none;
  overflow: hidden auto;
  overscroll-behavior-y: contain;
  border-radius: 0;
  scrollbar-width: none;
}
.editorial-refresh .feed-frame::-webkit-scrollbar { display: none; }
.editorial-refresh .feed-frame:focus-visible { outline: 2px solid var(--editorial-accent); outline-offset: -2px; }
.editorial-refresh .feed-flow,
.editorial-refresh .feed-cover { position: relative; height: 100%; }
.editorial-refresh .feed-cover { overflow: clip; }
.editorial-refresh .feed-cover .feed-scroll { overflow: hidden; overscroll-behavior: auto; }
.editorial-refresh .feed-slide[data-kind=photo] > img { object-fit: cover; }
.editorial-refresh .feed-slide > :is(img, video) { object-position: center top; }
.editorial-refresh .feed-slide:after {
  inset: auto 0 0;
  height: min(260px, 48%);
  background: linear-gradient(180deg, transparent, #0007 38%, #000d 75%, var(--bg));
}
.editorial-refresh .feed-frame:has(.feed-primary:not([hidden])) { --repeat-space: 64px; }
.editorial-refresh .feed-frame:has(.repeat-availability:not([hidden])) { --repeat-space: 84px; }
.editorial-refresh .feed-header { padding: 0; pointer-events: none; }
.editorial-refresh .feed-rail .feed-control {
  position: static;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: white;
  pointer-events: auto;
}
.editorial-refresh .feed-rail .feed-control svg { width: 24px; height: 24px; stroke-width: 1.7; filter: none; }
.editorial-refresh .feed-rail .feed-control:disabled { opacity: .58; cursor: default; }
.editorial-refresh .feed-like[aria-pressed=true] svg { fill: #ff819d; stroke: #ff819d; }
.editorial-refresh .feed-frame .feed-caption {
  inset: auto 61px calc(80px + var(--safe-bottom) + var(--repeat-space)) 16px;
}
.editorial-refresh .feed-caption h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.035em; line-height: 1.25; }
.editorial-refresh .feed-caption .sora-current-views { min-height: 28px; font-size: 12px; }
.editorial-refresh .sora-current-views .editorial-views {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.editorial-refresh .feed-frame .feed-rail {
  inset: auto 16px calc(91px + var(--safe-bottom) + var(--repeat-space)) auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  z-index: 11;
  padding: 0;
}
.feed-primary {
  position: absolute;
  z-index: 8;
  inset: auto 16px calc(78px + var(--safe-bottom));
}
.editorial-refresh .feed-primary .solid-button {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 15px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 700;
}
.editorial-refresh .feed-primary .solid-button:not(:disabled),
.editorial-refresh .generation-submit:not(:disabled) {
  color: #191c10;
  background: var(--editorial-accent);
  border-color: var(--editorial-accent);
}
.editorial-refresh .feed-primary .solid-button:disabled { background: #e0ff5966; color: #fbfbe8; }
.editorial-refresh .repeat-availability {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--editorial-text);
  text-shadow: 0 1px 4px #000;
}
.editorial-refresh .feed-related {
  position: relative;
  z-index: 5;
  margin-top: calc(-72px - var(--safe-bottom));
  padding: 0 var(--designer-gap) calc(96px + var(--safe-bottom));
  background: var(--bg);
}
.editorial-refresh .feed-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--designer-gap);
}
.designer-profile-actions summary {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  list-style: none;
  border: 1px solid #ffffff14;
  border-radius: 50%;
  background: #171719e8;
  cursor: pointer;
}
.designer-profile-actions summary::-webkit-details-marker { display: none; }
.designer-profile-actions summary svg { width: 22px; height: 22px; }
.designer-profile-actions-list {
  position: absolute;
  z-index: 12;
  inset: calc(100% + 6px) 0 auto auto;
  display: grid;
  gap: 3px;
  width: max-content;
  max-width: min(276px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg);
}
.editorial-refresh .designer-profile-actions-list button {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: 37px;
  height: auto;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--editorial-text);
  text-align: left;
  font-size: 13px;
}
.editorial-refresh .sheet { background: var(--surface); }
.editorial-refresh .sheet:has(.create-choice) {
  inset: auto 0 max(0px, calc(100dvh - var(--tg-viewport-stable-height, 100dvh)));
  width: min(100%, var(--designer-width));
  max-width: none;
  max-height: calc(100% - 16px);
  margin: 0 auto;
  border: 0;
  border-radius: 36px 36px 0 0;
  background: var(--bg);
}
.editorial-refresh .sheet:has(.create-choice)::backdrop { background: #0009; backdrop-filter: none; }
.editorial-refresh .sheet:has(.create-choice) :is(.sheet-handle, .sheet-header button) { display: none; }
.editorial-refresh .sheet:has(.create-choice) .sheet-header { min-height: 56px; padding: 16px 16px 12px; }
.editorial-refresh .sheet:has(.create-choice) .sheet-header h2 { font-size: 20px; font-weight: 700; }
.editorial-refresh .sheet:has(.create-choice) .sheet-content { display: grid; gap: 8px; padding: 0 16px; }
.editorial-refresh .create-choice {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  border-radius: 0;
  padding: 16px 8px;
  margin: 0;
  background: transparent;
}
.editorial-refresh .create-choice + .create-choice { border-top: 1px solid var(--line); }
.editorial-refresh .create-choice svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-inline: 8px;
  color: var(--editorial-accent);
}
.create-choice strong, .create-choice small { display: block; }
.create-choice strong { font-size: 17px; letter-spacing: -.025em; }
.create-choice small { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 400; }
.designer-menu-footer { display: none; }
.editorial-refresh .sheet:has(.create-choice) .designer-menu-footer { display: block; flex: none; padding: 8px 16px 12px; }
.designer-menu-footer button { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 16px; font-weight: 650; }
.editorial-refresh .profile-screen { max-width: none; padding: 0; }
.editorial-refresh .profile-top { min-height: 62px; padding: 10px 16px 8px; color: var(--muted); }
.editorial-refresh .profile-top > .round-button {
  right: 16px;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--editorial-text);
}
.editorial-refresh .profile-top > .designer-profile-back { right: auto; left: 16px; }
.designer-profile-heading { font-size: 14px; }
.editorial-refresh .profile-identity { margin: 16px 0 15px; padding: 0 14px; }
.editorial-refresh .profile-identity h1 { width: fit-content; max-width: 100%; margin: 0 auto; font-size: 25px; line-height: 1.15; letter-spacing: -.04em; overflow-wrap: anywhere; }
.editorial-refresh .profile-avatar { position: relative; width: 100px; height: 100px; margin-bottom: 14px; overflow: visible; background: var(--surface); }
.editorial-refresh .profile-avatar img { border-radius: 50%; }
.editorial-refresh .profile-avatar:not(.has-photo) img,
.editorial-refresh .profile-avatar.has-photo .designer-avatar-fallback { display: none; }
.editorial-refresh .designer-avatar-fallback { width: 38px; height: 38px; color: var(--muted); }
.designer-avatar-edit {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--surface);
  border: 2px solid var(--bg);
  border-radius: 50%;
}
.designer-avatar-edit svg { width: 14px; height: 14px; }
.editorial-refresh .profile-wallet {
  width: fit-content;
  max-width: calc(100% - 90px);
  gap: 9px;
  min-height: 44px;
  margin: 0 auto;
  padding: 0 10px;
  border: 1px solid #717e3b;
  background: #252b16;
  color: var(--editorial-accent);
  border-radius: 999px;
}
.editorial-refresh .profile-wallet button { min-height: 42px; }
.editorial-refresh .profile-wallet .wallet-add { min-width: 30px; padding: 0; color: inherit; background: transparent; font-size: 0; }
.editorial-refresh .profile-wallet .wallet-add:before { content: '+'; font-size: 20px; }
.editorial-refresh .profile-wallet .wallet-summary strong { font-size: 15px; color: var(--editorial-accent); }
.designer-profile-note { min-height: 40px; padding: 7px 14px 10px; color: var(--muted); font-size: 11px; text-align: center; }
.designer-profile-note p { margin: 0; overflow-wrap: anywhere; }
.designer-preview .profile-wallet { width: 155px; gap: 6px; padding-inline: 9px; }
.designer-preview .profile-wallet .wallet-add { min-width: 20px; width: 20px; border: 0; }
.designer-preview #wallet-total { white-space: nowrap; }
.designer-preview :is(.profile-wallet .wallet-summary, .header-balance) svg { display: none; }
.designer-preview :is(.profile-wallet .wallet-summary, .header-balance)::before { content: '✦'; margin-right: 3px; font-size: 12px; }
.designer-preview #profile-bio { display: none; }
.editorial-refresh .profile-status:empty { display: none; }
.profile-top .designer-profile-actions { position: absolute; right: 16px; z-index: 4; }
.profile-top .designer-profile-actions summary { width: 44px; height: 44px; }
.editorial-refresh .profile-tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 53px; margin: 0; background: var(--bg); }
.editorial-refresh .profile-tabs button { justify-content: center; min-height: 52px; padding: 8px 3px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.editorial-refresh .profile-tabs button[aria-selected=true] { border-bottom-color: var(--editorial-accent); color: var(--editorial-text); }
.editorial-refresh .profile-tabs button[aria-selected=true]:after { content: none; }
.editorial-refresh .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--designer-gap); padding: 10px var(--designer-gap) 24px; }
.designer-preview .profile-grid { min-height: 0; padding-bottom: 0; }
.job-progress { display: block; height: 4px; margin-top: 8px; border-radius: 999px; overflow: hidden; background: #ffffff26; }
.job-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--editorial-accent);
  transform-origin: left;
  transform: scaleX(var(--job-progress, .05));
}
.job-progress[data-estimated] > span { animation: job-progress-grow var(--job-duration) linear var(--job-offset) both; }
@keyframes job-progress-grow {
  from { transform: scaleX(.05); }
  to { transform: scaleX(.985); }
}
@media (prefers-reduced-motion: reduce) {
  .job-progress[data-estimated] > span { animation: none; }
}

.editorial-refresh .profile-grid .gallery-tile { border-radius: var(--designer-card-radius); }
.designer-work-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--designer-card-radius);
  background: var(--surface);
  color: var(--editorial-text);
}
.designer-work-tile > :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; }
.designer-work-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.designer-work-tile[data-demo-status=ready] :is(.designer-work-status, .tile-icon) {
  inset: auto 9px 9px auto;
  padding: 5px;
  border-radius: 12px;
  background: #151517aa;
}
.designer-work-tile[data-demo-status=ready] .tile-icon { width: 25px; height: 25px; }
.designer-work-tile:is([data-demo-status=working], [data-demo-status=error]) > img { opacity: .25; filter: blur(6px); transform: scale(1.1); }
.designer-work-tile[data-demo-status=error] { background: #332228; }
.designer-work-tile[data-demo-status=error] .designer-work-status { color: #ffd1d9; }
.designer-work-tile .work-demo { position: absolute; z-index: 2; left: 9px; top: 9px; padding: 3px 5px; border-radius: 12px; background: #151517a8; font-size: 10px; }
.designer-work-tile .work-spinner { width: 22px; height: 22px; border: 2px solid #ffffff38; border-top-color: var(--editorial-accent); border-radius: 50%; animation: designer-work-spin 1s linear infinite; }
@keyframes designer-work-spin { to { transform: rotate(360deg); } }
.editorial-refresh .create-screen[data-repeat] {
  padding-bottom: 9px;
  background: radial-gradient(ellipse at 50% 30%, #262322, var(--bg) 60%);
}
.editorial-refresh .create-screen[data-repeat] .page-header { margin-inline: -16px; padding-inline: 16px; background: transparent; flex: none; }
.editorial-refresh .create-screen[data-repeat] .creation-stage { flex: 1 0 auto; min-height: 100px; width: calc(100% + 32px); margin-inline: -16px; padding: 14px; }
.studio-photo-drop {
  position: relative;
  display: grid;
  flex: 1;
  place-items: center;
  width: 100%;
  min-height: 86px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  color: var(--editorial-text);
  background: transparent;
}
.studio-photo-drop:is(:focus-visible, .is-dragging) { outline: 2px solid var(--editorial-accent); }
.studio-photo-label { display: grid; justify-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.studio-photo-plus { display: grid; place-items: center; width: clamp(42px, 8dvh, 70px); aspect-ratio: 1; border-radius: 50%; background: #e0ff5915; color: var(--editorial-accent); }
.studio-photo-plus svg { width: 56%; height: 56%; }
.studio-photo-preview { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.studio-photo-preview:not([hidden]) + .studio-photo-label { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 5px; padding: 4px 10px 4px 4px; border-radius: 20px; background: var(--surface); font-size: 12px; }
.studio-photo-preview:not([hidden]) + .studio-photo-label .studio-photo-plus { width: 26px; }
.editorial-refresh .create-screen[data-repeat] .creation-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 0;
  color: var(--muted);
}
.editorial-refresh .creation-empty h2 { margin: 0; color: var(--editorial-text); font-size: 19px; font-weight: 500; letter-spacing: normal; }
.editorial-refresh .creation-empty p { display: block; margin: 0; color: var(--muted); font-size: 13px; }
.editorial-refresh .creation-orbit { width: 56px; height: 56px; margin: 0 0 7px; border: 1px solid var(--line); border-radius: 24px; }
.editorial-refresh .creation-orbit:before, .editorial-refresh .creation-orbit:after { content: none; }
.editorial-refresh .creation-orbit svg { width: 23px; height: 23px; color: var(--muted); }
.editorial-refresh .create-screen[data-repeat] .creation-form { flex: none; padding-top: 12px; }
.designer-preview .create-screen:not([data-repeat=true]) :is(.creation-options, .creation-footer, [data-picker-tab=styles], #generation-price) { display: none; }
.editorial-refresh .create-screen[data-repeat] .character-heading { align-items: center; min-height: 36px; margin: 0; }
.editorial-refresh .create-screen[data-repeat] .character-heading .creation-picker-tabs button[aria-selected=true] {
  padding: 0;
  border: 0;
  color: var(--editorial-text);
  font-size: 15px;
  font-weight: 600;
}
.editorial-refresh .create-screen[data-repeat] #all-characters { min-height: 36px; color: var(--muted); font-size: 13px; }
.editorial-refresh .create-screen[data-repeat] .characters { min-height: 100px; height: auto; gap: 16px; margin: 0; padding: 5px 3px 13px; }
.editorial-refresh .create-screen[data-repeat] .character { width: 64px; gap: 7px; color: var(--muted); }
.editorial-refresh .create-screen[data-repeat] .character > :is(img, span) { width: 58px; height: 58px; border-radius: 50%; }
.editorial-refresh .create-screen[data-repeat] .character small { font-size: 12px; }
.editorial-refresh .create-screen[data-repeat] .prompt-box { padding: 0; border: 0; background: transparent; box-shadow: none; }
.editorial-refresh .create-screen[data-repeat] .prompt-box textarea {
  display: block;
  min-height: 75px;
  padding: 14px;
  border: 1px solid #434145;
  border-radius: 24px;
  background: #1a191bd9;
  line-height: 1.4;
}
.editorial-refresh .create-screen[data-repeat] .prompt-box textarea::placeholder { color: #a6a3ab; }
.editorial-refresh .create-screen[data-repeat] .creation-actions {
  position: static;
  display: flex;
  flex-direction: column;
  margin: 4px 0 0;
  padding: 0 0 var(--safe-bottom);
  background: transparent;
}
.editorial-refresh .create-screen[data-repeat] .creation-actions #create-status {
  order: 2;
  min-height: 15px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.editorial-refresh .create-screen[data-repeat] .creation-actions #create-status.has-error { color: #ffb6b6; }
.editorial-refresh .create-screen[data-repeat] .generation-submit { order: 1; border-radius: 24px; font-weight: 750; }
.editorial-refresh .create-screen[data-repeat] .generation-submit:disabled { background: #738338; color: #191c10; opacity: 1; }
.designer-studio-note { display: none; }
.designer-preview .create-screen[data-repeat] .designer-studio-note {
  display: block;
  order: 2;
  margin: 7px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
}
.designer-preview .create-screen[data-repeat] #create-status:not(.has-error) { display: none; }
.designer-preview .create-screen[data-repeat] .creation-actions:has(#create-status.has-error) .designer-studio-note { display: none; }
.editorial-refresh .creation-form .prompt-box { border-color: var(--line); background: var(--surface); }
.editorial-refresh .creation-empty p { color: var(--muted); }
.repeat-photo-drop {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  width: 100%;
  flex: 1;
  min-height: 100px;
  padding: 10px 14px;
  border: 1px dashed #e0ff5970;
  border-radius: 28px;
  background: radial-gradient(ellipse at center, #e0ff5914, transparent 65%), var(--surface);
  color: var(--editorial-text);
  text-align: center;
}
.repeat-photo-drop:is(:hover, .is-dragging) { border-color: var(--editorial-accent); }
.repeat-photo-drop.is-dragging { background: #e0ff5926; }
.repeat-photo-plus {
  display: grid;
  place-items: center;
  width: clamp(48px, 10dvh, 96px);
  aspect-ratio: 1;
  border: 1px solid #e0ff594a;
  border-radius: 50%;
  background: #e0ff5915;
  color: var(--editorial-accent);
  font-size: clamp(48px, 16vw, 68px);
  line-height: 1;
}
.repeat-photo-plus svg { width: 58%; height: 58%; stroke-width: 1.6; }
.repeat-photo-title { color: var(--editorial-text); font-size: clamp(17px, 5vw, 21px); font-weight: 700; }
.repeat-photo-hint { max-width: 28ch; color: var(--muted); font-size: 13px; line-height: 1.35; }
.editorial-refresh .create-screen { padding-inline: 16px; }
.editorial-refresh .create-screen .page-header { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; }
.editorial-refresh .create-screen .page-header h1 { justify-self: start; font-size: 17px; }
.editorial-refresh .create-screen .create-back {
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}
.editorial-refresh .create-screen .header-balance {
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid #e0ff5955;
  border-radius: 999px;
  background: #e0ff5912;
  color: var(--editorial-accent);
}
/* Once a reference is selected the next upload belongs beside the source. */
.repeat-add-photo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--editorial-text);
  background: var(--surface);
}
.repeat-add-photo svg { width: 18px; height: 18px; }
@media (max-width: 350px) {
  .editorial-refresh .trend-tabs { gap: 5px; }
  .editorial-refresh .trend-tabs button { padding-inline: 9px; font-size: 13px; }
}
@media (max-height: 560px) {
  .editorial-refresh .create-screen[data-repeat] .creation-stage { min-height: 65px; padding-block: 2px; }
  .editorial-refresh .create-screen[data-repeat] .creation-empty { padding-block: 4px; }
  .editorial-refresh .create-screen[data-repeat] .creation-empty :is(.creation-orbit, p) { display: none; }
  .editorial-refresh .create-screen[data-repeat] .characters { min-height: 72px; gap: 10px; padding-bottom: 8px; }
  .editorial-refresh .create-screen[data-repeat] .character > :is(img, span) { width: 42px; height: 42px; }
  .editorial-refresh .create-screen[data-repeat] .prompt-box textarea { min-height: 65px; }
}
@media (min-height: 601px) {
  .editorial-refresh .create-screen[data-repeat] .creation-empty { transform: translateY(9px); }
}
