.workspace {
  position: relative;
  min-height: 688px;
  min-height: max(688px, calc(100dvh - 88px));
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 286px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
}

.tool-rail {
  position: relative;
  z-index: 8;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 9px 12px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.rail-label {
  margin: 0 0 13px;
  color: #979aa3;
  text-align: center;
}

.tool-tab {
  position: relative;
  min-height: 104px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  margin-bottom: 7px;
  padding: 13px 4px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #676b75;
  background: transparent;
}

.tool-tab::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -10px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
}

.tool-tab:hover {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.tool-tab.active {
  color: var(--ink);
  border-color: rgba(114, 100, 243, 0.18);
  background: #fff;
  box-shadow: 0 9px 25px rgba(30, 31, 36, 0.08);
}

.tool-tab.active::before {
  background: var(--violet);
}

.tool-tab svg {
  width: 19px;
  height: 19px;
}

.tool-tab b {
  font-size: 11px;
}

.tool-tab small {
  font-size: 8px;
  font-weight: 820;
}

.tool-index {
  position: absolute;
  top: 6px;
  right: 7px;
  color: #b3b5bb;
  font-size: 8px;
  font-weight: 820;
}

.rail-spacer {
  flex: 1;
}

.rail-focus {
  margin: 0 auto;
}

.tool-surface {
  position: relative;
  min-width: 0;
  min-height: 688px;
  background: #dfe1e5;
  overflow: hidden;
}

.feature-offline-notice {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 40px;
  text-align: center;
  color: #34373d;
  background:
    radial-gradient(circle at 50% 42%, rgba(114, 100, 243, 0.14), transparent 30%),
    linear-gradient(145deg, #f1f2f5, #d9dce2);
}

.feature-offline-notice[hidden] {
  display: none;
}

.feature-offline-notice h1,
.feature-offline-notice p {
  margin: 0;
}

.feature-offline-notice h1 {
  font-size: clamp(28px, 4vw, 54px);
  letter-spacing: -0.045em;
}

.feature-offline-notice p {
  max-width: 460px;
  color: #6e737d;
  line-height: 1.7;
}

.tool-panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(272px, 314px) minmax(420px, 1fr);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(14px);
}

.tool-panel.active {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  transition: opacity 300ms ease, transform 420ms cubic-bezier(.2,.8,.2,1);
}

.control-deck {
  position: relative;
  z-index: 5;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 23px 22px;
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(155deg, #211930 0%, #17171d 58%, #121318 100%);
  background-size: 32px 32px, 32px 32px, auto;
  box-shadow: 14px 0 34px rgba(18, 18, 23, 0.13);
  overflow: auto;
}

.control-deck::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), var(--coral), var(--site-warm));
}

.control-deck .eyebrow {
  color: #aca3ff;
}

.run-button {
  width: 100%;
  min-height: 48px;
  margin-top: auto;
  justify-content: flex-start;
  padding: 0 12px 0 15px;
  color: var(--ink);
  background: #fff;
}

.run-button:hover {
  color: #fff;
  background: var(--violet);
}

.run-button span {
  flex: 1;
  text-align: left;
}

.run-button small {
  padding: 4px 5px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 8px;
}

.run-button.requires-login {
  color: #5f5670;
  background: #f3f0ff;
}

.run-button.requires-login:hover {
  color: #fff;
  background: var(--violet);
}

.canvas-deck {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 32px;
  padding: 12px 14px 10px;
  background:
    linear-gradient(rgba(20, 21, 25, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 21, 25, 0.035) 1px, transparent 1px),
    #e7e8eb;
  background-size: 28px 28px, 28px 28px, auto;
  overflow: hidden;
}

.generation-overlay {
  position: absolute;
  top: 64px;
  right: 14px;
  bottom: 42px;
  left: 14px;
  z-index: 24;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  background: #17181e;
  box-shadow: 0 26px 70px rgba(18, 19, 25, 0.34);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.985);
  overflow: hidden;
  transition: opacity 220ms ease, transform 320ms cubic-bezier(.2,.8,.2,1), visibility 220ms ease;
}

.generation-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.generation-reel {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.generation-reel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  background:
    radial-gradient(circle at 58% 42%, transparent 0 28%, rgba(12,13,17,.18) 54%, rgba(12,13,17,.58) 100%),
    linear-gradient(180deg, rgba(14,15,20,.02) 0%, transparent 48%, rgba(14,15,20,.58) 100%);
  pointer-events: none;
}

.generation-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.generation-base {
  z-index: 1;
  filter: grayscale(.42) saturate(.92) contrast(.92) brightness(.92) blur(1.4px);
  transform: scale(1.025);
  animation: generationDevelop 8.6s ease-in-out infinite;
}

.generation-depth {
  z-index: 3;
  opacity: .32;
  mix-blend-mode: soft-light;
  will-change: transform, opacity, filter;
}

.generation-depth-a {
  filter: saturate(1.18) contrast(1.02) brightness(1.08) blur(.6px);
  transform-origin: 56% 42%;
  animation: generationDepthA 8.8s cubic-bezier(.2,.8,.2,1) infinite;
}

.generation-depth-b {
  opacity: .24;
  filter: saturate(1.35) hue-rotate(-8deg) contrast(1.05) blur(1.1px);
  transform-origin: 44% 55%;
  animation: generationDepthB 10.4s cubic-bezier(.2,.8,.2,1) infinite;
}

.generation-spectrum {
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    linear-gradient(110deg, transparent 8%, rgba(97,216,209,.12) 28%, transparent 48%),
    linear-gradient(122deg, transparent 42%, rgba(114,100,243,.16) 62%, transparent 79%),
    linear-gradient(135deg, transparent 66%, rgba(239,125,147,.12) 84%, transparent 96%);
  background-size: 170% 100%;
  mix-blend-mode: screen;
  animation: generationSpectrum 7.8s ease-in-out infinite;
}

.generation-soft-mask {
  position: absolute;
  inset: 0;
  z-index: 8;
  background:
    radial-gradient(circle at 52% 36%, rgba(255,255,255,.28), transparent 18%),
    radial-gradient(circle at 38% 62%, rgba(97,216,209,.2), transparent 24%),
    radial-gradient(circle at 68% 58%, rgba(239,125,147,.16), transparent 26%);
  filter: blur(20px);
  mix-blend-mode: screen;
  opacity: .42;
  animation: generationSoftMask 7.2s ease-in-out infinite;
}

.generation-grain {
  position: absolute;
  inset: 0;
  z-index: 11;
  opacity: .14;
  background-image:
    linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 5px 5px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 72%, transparent);
  animation: generationGrain 1.4s steps(3) infinite;
}

.generation-focus {
  position: absolute;
  top: 14%;
  right: 13%;
  z-index: 10;
  width: 36%;
  height: 56%;
  border: 1px solid rgba(255,255,255,.58);
  box-shadow: 0 0 0 1px rgba(20,21,25,.12), 0 18px 70px rgba(0,0,0,.16);
  animation: generationFocus 5.4s ease-in-out infinite;
}

.generation-focus span {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
}

.generation-focus span:nth-child(1) { top: -5px; left: -5px; }
.generation-focus span:nth-child(2) { top: -5px; right: -5px; }
.generation-focus span:nth-child(3) { bottom: -5px; right: -5px; }
.generation-focus span:nth-child(4) { bottom: -5px; left: -5px; }

.generation-scan {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8%;
  z-index: 12;
  width: 1px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 0 0 1px rgba(97,216,209,.32), 0 0 58px 18px rgba(97,216,209,.16);
  animation: generationScanX 5.8s ease-in-out infinite;
}

.generation-scan::before {
  content: "ANALYZING";
  position: absolute;
  top: 12px;
  left: 8px;
  padding: 5px 6px;
  border-radius: 3px;
  color: #fff;
  background: rgba(20,21,25,.72);
  font-size: 7px;
  font-weight: 820;
}

.generation-console {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 18;
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 5px auto;
  align-items: end;
  gap: 9px 18px;
  padding: 13px 14px 11px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  background: rgba(18,19,24,.76);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 38px rgba(0,0,0,.22);
}

.generation-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.generation-copy > span {
  color: #aaa1ff;
  font-size: 7px;
  font-weight: 840;
}

.generation-copy b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generation-copy small {
  overflow: hidden;
  color: rgba(255,255,255,.54);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generation-console > strong {
  align-self: center;
  font-size: 24px;
  line-height: 1;
}

.generation-progress {
  position: relative;
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
}

.generation-progress i {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--coral), var(--site-warm));
  box-shadow: 0 0 18px rgba(114,100,243,.52);
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}

.generation-overlay.is-indeterminate .generation-progress i {
  width: 34% !important;
  animation: generationIndeterminate 1.5s ease-in-out infinite;
}

@keyframes generationIndeterminate {
  0% { transform: translateX(-115%); }
  55%, 100% { transform: translateX(305%); }
}

.generation-steps {
  grid-column: 1 / -1;
  display: flex;
  gap: 5px;
}

.generation-steps span {
  width: 17px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.18);
  transition: background 220ms ease, width 220ms ease;
}

.generation-steps span.active {
  width: 28px;
  background: rgba(255,255,255,.82);
}

.generation-overlay.is-complete .generation-progress i,
.generation-overlay.is-complete .generation-focus span {
  background: var(--mint);
}

.generation-overlay.is-complete .generation-scan {
  left: 96%;
  animation: none;
  box-shadow: 0 0 38px 14px rgba(141,215,181,.24);
}

.generation-overlay.is-complete .generation-copy > span {
  color: var(--mint);
}

.generation-overlay.is-failed .generation-progress i,
.generation-overlay.is-failed .generation-focus span {
  background: var(--coral);
}

.generation-overlay.is-failed .generation-copy > span {
  color: var(--coral);
}

/* Progress is expressed as a photographic development, not a scanner overlay. */
.generation-overlay {
  --generation-progress: 4%;
  --generation-accent: var(--violet);
}

.generation-overlay[data-tool="match"] { --generation-accent: var(--cyan); }
.generation-overlay[data-tool="correct"] { --generation-accent: var(--coral); }

.generation-overlay.active {
  pointer-events: auto;
}

.generation-reel::after {
  z-index: 9;
  background:
    linear-gradient(180deg, rgba(13,14,18,.18), transparent 34%),
    linear-gradient(0deg, rgba(13,14,18,.62), transparent 44%);
}

.generation-base {
  z-index: 1;
  filter: grayscale(.72) saturate(.52) contrast(.9) brightness(.72) blur(1px);
  transform: scale(1.035);
  animation: generationBaseDrift 13s ease-in-out infinite alternate;
}

.generation-developed {
  z-index: 2;
  filter: saturate(1.04) contrast(1.02) brightness(1.02);
  clip-path: inset(0 calc(100% - var(--generation-progress)) 0 0);
  transform: scale(1.018);
  transition: clip-path 720ms cubic-bezier(.2,.8,.2,1);
  will-change: clip-path;
}

.generation-echo {
  z-index: 4;
  opacity: .16;
  mix-blend-mode: screen;
  filter: saturate(1.35) contrast(1.08);
  mask-image: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 25px);
  pointer-events: none;
}

.generation-echo-a {
  transform: translate3d(-7px, 0, 0) scale(1.02);
  animation: generationEchoA 4.8s ease-in-out infinite;
}

.generation-echo-b {
  opacity: .11;
  filter: saturate(1.45) hue-rotate(-12deg);
  mask-image: repeating-linear-gradient(90deg, transparent 0 16px, #000 16px 20px, transparent 20px 38px);
  transform: translate3d(8px, 0, 0) scale(1.025);
  animation: generationEchoB 6.2s ease-in-out infinite;
}

.generation-latent-field {
  position: absolute;
  top: 9%;
  bottom: 24%;
  left: clamp(3%, calc(var(--generation-progress) - 28px), calc(97% - 56px));
  z-index: 7;
  width: 56px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  opacity: .72;
  transition: left 720ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.generation-latent-field i {
  width: 2px;
  height: 100%;
  align-self: center;
  background: rgba(255,255,255,.32);
  box-shadow: 0 0 18px color-mix(in srgb, var(--generation-accent) 60%, transparent);
  animation: generationLatent 2.8s ease-in-out infinite;
}

.generation-latent-field i:nth-child(2) { height: 72%; animation-delay: -.5s; }
.generation-latent-field i:nth-child(3) { height: 88%; animation-delay: -1.2s; }
.generation-latent-field i:nth-child(4) { height: 58%; animation-delay: -1.8s; }
.generation-latent-field i:nth-child(5) { height: 82%; animation-delay: -.9s; }
.generation-latent-field i:nth-child(6) { height: 46%; animation-delay: -2.2s; }

.generation-development-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--generation-progress);
  z-index: 8;
  width: 1px;
  background: rgba(255,255,255,.54);
  box-shadow: 0 0 38px 13px color-mix(in srgb, var(--generation-accent) 28%, transparent);
  transition: left 720ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.generation-development-edge i {
  position: absolute;
  left: 0;
  width: 14px;
  height: 1px;
  background: rgba(255,255,255,.72);
}

.generation-development-edge i:nth-child(1) { top: 23%; }
.generation-development-edge i:nth-child(2) { top: 51%; width: 22px; transform: translateX(-100%); }
.generation-development-edge i:nth-child(3) { top: 76%; width: 9px; }

.generation-aperture {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 12;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  opacity: .86;
  pointer-events: none;
}

.generation-aperture i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  border-top-color: var(--generation-accent);
  animation: generationAperture 7s linear infinite;
}

.generation-aperture i:nth-child(2) { inset: 9px; animation-duration: 5.4s; animation-direction: reverse; }
.generation-aperture i:nth-child(3) { inset: 19px; animation-duration: 3.8s; }

.generation-aperture b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--generation-accent) 24%, transparent);
}

.generation-stage-index {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 12;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  text-shadow: 0 5px 20px rgba(0,0,0,.32);
}

.generation-stage-index b {
  font-size: 25px;
  line-height: 1;
}

.generation-stage-index span {
  color: rgba(255,255,255,.52);
  font-size: 7px;
  font-weight: 820;
}

.generation-grain {
  z-index: 6;
  opacity: .08;
  background-size: 6px 6px;
}

.generation-metrics {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.generation-metrics span {
  color: rgba(255,255,255,.46);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.generation-metrics strong {
  min-width: 56px;
  font-size: 24px;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.generation-steps span.active {
  background: var(--generation-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--generation-accent) 38%, transparent);
}

.generation-overlay.is-complete .generation-development-edge {
  opacity: 0;
}

.generation-overlay.is-complete .generation-aperture b {
  background: var(--mint);
}

.generation-overlay.is-failed .generation-aperture b {
  background: var(--coral);
}

@keyframes generationBaseDrift {
  0% { transform: translate3d(-.8%, -.4%, 0) scale(1.035); }
  100% { transform: translate3d(.9%, .5%, 0) scale(1.065); }
}

@keyframes generationEchoA {
  0%, 100% { opacity: .08; transform: translate3d(-8px, 0, 0) scale(1.02); }
  50% { opacity: .2; transform: translate3d(5px, 0, 0) scale(1.03); }
}

@keyframes generationEchoB {
  0%, 100% { opacity: .06; transform: translate3d(9px, 0, 0) scale(1.025); }
  50% { opacity: .15; transform: translate3d(-4px, 0, 0) scale(1.035); }
}

@keyframes generationLatent {
  0%, 100% { opacity: .18; transform: scaleY(.78); }
  50% { opacity: .92; transform: scaleY(1); }
}

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

body.is-loading .tool-tab,
body.is-loading .run-button,
body.is-loading [data-open-tool],
body.is-loading .dropzone,
body.is-loading .canvas-tools {
  pointer-events: none;
}

body.is-loading .tool-tab:not(.active) {
  opacity: .46;
}

.canvas-toolbar {
  position: relative;
  z-index: 6;
  justify-content: space-between;
  gap: 14px;
  padding: 0 3px 10px;
}

.canvas-toolbar > div:first-child {
  min-width: 0;
  gap: 8px;
}

.canvas-toolbar b {
  font-size: 10px;
  white-space: nowrap;
}

.canvas-toolbar small {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--mint);
}

.live-dot.violet { background: var(--violet); box-shadow: 0 0 0 4px rgba(114,100,243,.18); }
.live-dot.coral { background: var(--coral); box-shadow: 0 0 0 4px rgba(239,125,147,.18); }

.canvas-tools {
  gap: 4px;
}

.canvas-tools .icon-button,
.zoom-readout {
  height: 32px;
  border-color: rgba(20, 21, 25, 0.1);
  background: rgba(255, 255, 255, 0.8);
}

.canvas-tools .icon-button {
  width: 32px;
}

.canvas-tools svg {
  width: 14px;
  height: 14px;
}

.zoom-readout {
  min-width: 51px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #676b74;
  font-size: 9px;
  font-weight: 780;
}

.tool-grid {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.dropzone {
  position: relative;
  width: min(100%, 920px);
  min-width: 0;
  height: min(100%, 560px);
  min-height: 360px;
  display: block;
  border: 1px solid rgba(20, 21, 25, 0.13);
  border-radius: 8px;
  background: #f7f7f8;
  box-shadow: 0 24px 55px rgba(25, 27, 33, 0.14);
  cursor: pointer;
  overflow: hidden;
  transform: scale(var(--stage-zoom));
  transform-origin: center;
  transition: transform 260ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 30%),
    linear-gradient(0deg, rgba(15,16,20,.18), transparent 34%);
  opacity: .72;
  transition: opacity 220ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: rgba(114, 100, 243, 0.64);
  box-shadow: 0 28px 65px rgba(38, 31, 83, 0.18);
}

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

.dropzone > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.82) contrast(.96);
  transform: scale(1.015);
  transition: filter 400ms ease, transform 600ms cubic-bezier(.2,.8,.2,1), opacity 240ms ease;
}

.dropzone:hover > img {
  filter: saturate(1) contrast(1);
  transform: scale(1.035);
}

.dropzone.has-file > img {
  filter: none;
  object-fit: contain;
  object-position: center !important;
  background-color: #dedfe2;
  background-image:
    linear-gradient(45deg, rgba(20,21,25,.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(20,21,25,.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(20,21,25,.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(20,21,25,.05) 75%);
  background-size: 22px 22px;
  transform: none;
  cursor: zoom-in;
}

.dropzone.has-file:hover > img {
  transform: none;
}

.lut-apply-preview {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  background-color: #dedfe2;
  background-image:
    linear-gradient(45deg, rgba(20,21,25,.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(20,21,25,.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(20,21,25,.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(20,21,25,.05) 75%);
  background-size: 22px 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.stage-correct.lut-preview-ready .lut-apply-preview {
  opacity: 1;
}

.stage-correct.lut-preview-ready > img[data-preview="correct"] {
  opacity: 0;
}

.lut-preview-badge {
  position: absolute;
  z-index: 7;
  top: 14px;
  right: 14px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  color: #fff;
  background: rgba(20,21,25,.7);
  box-shadow: 0 8px 24px rgba(20,21,25,.18);
  backdrop-filter: blur(10px);
  font-size: 9px;
  font-weight: 820;
  pointer-events: none;
}

.lut-apply-settings {
  display: grid;
  gap: 12px;
}

.lut-source-field {
  display: grid;
  gap: 7px;
}

.lut-source-field > span:first-child {
  color: #555962;
  font-size: 10px;
  font-weight: 780;
}

.lut-source-field .select-wrap {
  width: 100%;
}

.lut-source-field select {
  width: 100%;
}

.lut-file-button {
  width: 100%;
  min-height: 42px;
  justify-content: center;
}

.lut-intensity-row {
  margin-top: 2px;
}

.lut-source-status {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.drop-copy {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  min-width: 152px;
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 9px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  color: #fff;
  background: rgba(20, 21, 25, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  transition: background 180ms ease, transform 180ms ease;
}

.dropzone:hover .drop-copy {
  background: rgba(114, 100, 243, 0.88);
  transform: translateY(-2px);
}

.drop-copy > svg,
.drop-copy > [data-lucide] {
  grid-row: 1 / 3;
  align-self: center;
  width: 22px;
  height: 22px;
}

.drop-copy b { font-size: 11px; }
.drop-copy small { color: rgba(255,255,255,.68); font-size: 9px; }

.dropzone.has-file .drop-copy {
  min-width: 0;
  grid-template-columns: 20px 1fr;
  padding: 8px 10px;
  opacity: .78;
}

.dropzone.has-file .drop-copy > svg,
.dropzone.has-file .drop-copy > [data-lucide] { width: 16px; height: 16px; }
.dropzone.has-file .drop-copy small { display: none; }

.selection-frame {
  position: absolute;
  z-index: 4;
  top: 18%;
  right: 12%;
  width: 36%;
  height: 54%;
  border: 1px dashed rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(20, 21, 25, 0.15);
  pointer-events: none;
  animation: selectionBreathe 3.4s ease-in-out infinite;
}

.selection-frame::before,
.selection-frame::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  background: var(--violet);
}

.selection-frame::before { top: -5px; left: -5px; }
.selection-frame::after { right: -5px; bottom: -5px; }

.layer-token,
.stage-label {
  position: absolute;
  z-index: 5;
  padding: 6px 7px;
  border-radius: 4px;
  color: #fff;
  background: rgba(20,21,25,.74);
  backdrop-filter: blur(10px);
}

.token-a { top: 17%; right: 12%; transform: translateY(-110%); }
.token-b { top: 12px; left: 12px; }

.canvas-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 8px 3px 0;
  color: #8c9099;
}

.two-upload {
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
}

.two-upload .dropzone {
  width: 100%;
  height: min(100%, 540px);
}

.stage-reference > img {
  object-position: 72% center;
}

.stage-target > img {
  object-position: 25% center;
  filter: grayscale(.45) saturate(.45) brightness(.92);
}

.stage-label {
  top: 12px;
  left: 12px;
}

.transfer-line {
  position: relative;
  z-index: 7;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(114,100,243,.28);
  border-radius: 50%;
  color: #fff;
  background: var(--violet);
  box-shadow: 0 0 0 8px rgba(114,100,243,.12);
  animation: transferPulse 2.2s ease-in-out infinite;
}

.transfer-line::before,
.transfer-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 13px;
  height: 1px;
  background: rgba(114,100,243,.44);
}

.transfer-line::before { right: 100%; }
.transfer-line::after { left: 100%; }
.transfer-line svg { width: 15px; height: 15px; }

.analysis-scan {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(97,216,209,.55), 0 0 34px 10px rgba(97,216,209,.25);
  animation: analysisScan 4.2s ease-in-out infinite;
}

.drop-idle-frame {
  position: absolute;
  inset: 14px;
  z-index: 4;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(18,19,24,.08);
  opacity: .72;
  pointer-events: none;
  transition: border-color 180ms ease, opacity 180ms ease, inset 220ms ease;
}

.drop-idle-frame::before,
.drop-idle-frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(255,255,255,.94);
}

.drop-idle-frame::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.drop-idle-frame::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.dropzone.has-file::before,
.dropzone.has-file .drop-idle-frame {
  opacity: 0;
}

.dropzone:not(.has-file) > img {
  filter: saturate(.92) contrast(.98) brightness(1.035);
  transform: scale(1.02);
}

.dropzone:not(.has-file)::before {
  background:
    radial-gradient(circle at 18% 14%, rgba(255,255,255,.74), transparent 34%),
    radial-gradient(circle at 85% 80%, rgba(241,225,255,.38), transparent 44%),
    linear-gradient(145deg, rgba(255,250,239,.22), rgba(225,238,255,.16));
  opacity: .58;
  animation: dropIdleShadeBreath 8.6s ease-in-out infinite;
}

.dropzone:not(.has-file):hover > img,
.dropzone.dragging:not(.has-file) > img {
  filter: saturate(1) contrast(1) brightness(1.075);
  transform: scale(1.035);
  animation: none;
}

.dropzone:not(.has-file) .selection-frame,
.dropzone:not(.has-file) .layer-token,
.dropzone:not(.has-file) .analysis-scan {
  display: none;
}

.dropzone:not(.has-file) .drop-idle-frame {
  border-color: rgba(255,255,255,.7);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.26), 0 0 28px rgba(191,176,255,.16);
}

.dropzone:not(.has-file) .drop-copy {
  right: auto;
  bottom: 24px;
  left: 50%;
  min-width: 210px;
  max-width: calc(100% - 32px);
  color: #17181d;
  background: rgba(255,255,255,.91);
  border-color: rgba(255,255,255,.78);
  box-shadow: 0 16px 34px rgba(77,68,112,.16), 0 0 0 1px rgba(91,78,130,.06);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.dropzone:not(.has-file) .drop-copy::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(181,162,255,.42);
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  animation: dropIdlePulse 3.4s ease-out infinite;
}

.dropzone:not(.has-file) .drop-copy > svg {
  color: var(--violet);
}

.dropzone:not(.has-file) .drop-copy small {
  color: #737781;
}

.dropzone:not(.has-file):hover .drop-copy,
.dropzone.dragging:not(.has-file) .drop-copy {
  color: #17181d;
  background: #fff;
  transform: translate(-50%, -3px);
}

.dropzone.dragging .drop-idle-frame {
  inset: 10px;
  border-color: var(--violet);
  opacity: 1;
}

@keyframes dropIdleCamera {
  from { transform: translate3d(-.35%, -.15%, 0) scale(1.02); }
  to { transform: translate3d(.35%, .2%, 0) scale(1.035); }
}

@keyframes dropIdleBreath {
  0%, 100% { filter: saturate(.9) contrast(.98) brightness(1.025); }
  50% { filter: saturate(1) contrast(1) brightness(1.085); }
}

@keyframes dropIdleShadeBreath {
  0%, 100% { opacity: .48; }
  50% { opacity: .72; }
}

@keyframes dropIdlePulse {
  0%, 100% { opacity: .04; transform: scale(.995); }
  50% { opacity: .28; transform: scale(1.018); }
}

.result-panel {
  position: relative;
  z-index: 7;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px 14px;
  border-left: 1px solid var(--line);
  background: rgba(250, 250, 251, 0.96);
  overflow: auto;
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
}

.panel-head > div {
  min-width: 0;
}

.panel-head > div > span {
  display: block;
  margin-bottom: 3px;
  color: var(--violet);
  font-size: 8px;
  font-weight: 820;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
}

#jobState {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: #fff;
  font-size: 9px;
  font-weight: 820;
}

.result-stage {
  --compare-position: 50%;
  position: relative;
  aspect-ratio: var(--result-ratio, 1 / 1);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #eceef0;
  background-image:
    linear-gradient(45deg, rgba(20,21,25,.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(20,21,25,.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(20,21,25,.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(20,21,25,.05) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  overflow: hidden;
}

.result-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: inherit;
  pointer-events: none;
}

.result-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  overflow: hidden;
}

.result-media > img,
.result-original-layer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(.97);
  transition: opacity 320ms ease, transform 420ms cubic-bezier(.2,.8,.2,1);
}

.result-stage.has-image .result-media > img,
.result-stage.has-image .result-original-layer img {
  opacity: 1;
  transform: scale(1);
}

.result-original-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--compare-position)) 0 0);
  pointer-events: none;
}

.result-compare-labels {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.result-compare-labels span {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  color: #fff;
  background: rgba(20,21,25,.68);
  box-shadow: 0 6px 20px rgba(20,21,25,.18);
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
}

.result-stage.has-comparison .result-compare-labels {
  opacity: 1;
  visibility: visible;
}

.result-stage.show-original .result-original-layer {
  clip-path: inset(0);
}

.result-compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare-position);
  z-index: 4;
  width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  transform: translateX(-50%);
  touch-action: none;
}

.result-compare-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20,21,25,.24), 0 0 18px rgba(20,21,25,.28);
}

.result-compare-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  color: #fff;
  background: rgba(20,21,25,.78);
  transform: translate(-50%, -50%);
}

.result-compare-divider svg { width: 16px; height: 16px; }
.result-stage.show-original .result-compare-divider { opacity: 0; }

.result-stage.is-actual-size {
  place-items: start;
  overflow: auto;
  cursor: grab;
}

.result-stage.is-actual-size .result-media {
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
}

.result-stage.has-image {
  max-height: min(58vh, 640px);
  cursor: zoom-in;
}

.result-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #8d919a;
  z-index: 7;
}

.result-empty svg { width: 26px; height: 26px; }
.result-empty b { color: #656972; font-size: 11px; }
.result-empty small { font-size: 9px; }
.result-stage.has-image .result-empty { opacity: 0; pointer-events: none; }
.result-stage.is-image-error .result-empty { opacity: 1; pointer-events: auto; }

.result-stage.is-processing .result-empty svg,
.result-stage.is-image-loading .result-empty svg {
  color: var(--violet);
  animation: resultSpin 1.8s linear infinite;
}

.result-stage.is-processing::before,
.result-stage.is-image-loading::before {
  content: "";
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  height: 1px;
  background: #fff;
  box-shadow: 0 0 24px 7px rgba(114,100,243,.4);
  animation: resultScan 1.8s ease-in-out infinite;
}

.result-meta {
  min-height: 36px;
  padding: 9px 10px;
  border-left: 2px solid var(--violet);
  color: #646872;
  background: #f0f1f3;
  font-size: 11px;
  line-height: 1.5;
}

.result-actions {
  gap: 6px;
}

.result-actions .primary-button {
  min-width: 0;
  flex: 1;
}

.result-inspector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.result-view-mode {
  flex: 1;
  border-color: var(--line);
  background: #eceef1;
}

.result-view-mode button {
  min-height: 36px;
  color: #656972;
}

.result-view-mode button.active {
  color: #fff;
  background: #25272e;
}

.result-preview-button,
.result-hold-button {
  min-height: 44px;
  padding-inline: 11px;
}

.result-hold-button {
  user-select: none;
}

.job-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(114,100,243,.18);
  border-radius: 6px;
  color: #5f6370;
  background: rgba(114,100,243,.06);
  font-size: 11px;
  line-height: 1.4;
}

.job-details > div { display: flex; gap: 10px; flex: 0 0 auto; }
.job-details .text-button { color: #5747d4; font-size: 11px; }
.view-result-button { display: none; }

.history-panel {
  min-width: 0;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.panel-head.compact {
  margin-bottom: 9px;
}

.panel-head.compact h2 {
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 5px;
}

.history-item {
  min-width: 0;
  min-height: 45px;
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink);
  text-align: left;
  background: #f0f1f3;
  cursor: pointer;
}

.history-item:hover {
  border-color: rgba(114,100,243,.24);
  background: #fff;
}

.history-item b {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-empty {
  padding: 12px 0;
  color: #9a9da5;
  font-size: 9px;
}

.hero-strip {
  min-height: 122px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(255,255,255,.95);
  overflow: hidden;
}

.exhibition-label {
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 17px 20px;
  border-right: 1px solid var(--line);
}

.exhibition-label b {
  margin-top: 6px;
  font-size: 14px;
}

.exhibition-label small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.hero-stage,
.hero-showcase-panel,
.hero-showcase-viewport {
  min-width: 0;
  height: 100%;
}

.hero-showcase-viewport {
  padding: 10px;
  overflow: hidden;
}

.hero-showcase-track {
  display: flex;
  width: max-content;
  height: 100%;
  gap: 8px;
}

.hero-showcase:not(.is-sparse) .hero-showcase-track {
  animation: galleryFlow 36s linear infinite;
}

.hero-showcase-viewport:hover .hero-showcase-track {
  animation-play-state: paused;
}

.hero-showcase-card,
.hero-showcase-empty {
  position: relative;
  width: 238px;
  height: 100px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef0f2;
  overflow: hidden;
}

button.hero-showcase-card {
  display: block;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
}

.hero-showcase-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.hero-showcase-card:hover img {
  transform: scale(1.05);
}

.hero-showcase-card span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px;
  border-radius: 4px;
  color: #fff;
  background: rgba(20,21,25,.7);
  backdrop-filter: blur(10px);
}

.hero-showcase-card b,
.hero-showcase-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-showcase-card b { max-width: 50%; font-size: 8px; }
.hero-showcase-card small { color: rgba(255,255,255,.68); font-size: 7px; }

.hero-showcase-empty {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(114,100,243,.07), transparent 48%),
    #f1f2f4;
}

.hero-showcase-empty span { color: var(--violet); font-size: 8px; font-weight: 820; }
.hero-showcase-empty b { font-size: 10px; }
.hero-showcase-empty small { color: var(--muted); font-size: 8px; line-height: 1.45; }

.workspace.gallery-mode {
  grid-template-columns: 84px minmax(0, 1fr);
}

.workspace.gallery-mode .result-panel {
  display: none;
}

.gallery-panel {
  grid-template-columns: minmax(250px, 292px) minmax(0, 1fr);
  color: var(--ink);
  background: #eeedf0;
}

.gallery-intro {
  position: relative;
  z-index: 5;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 22px 22px;
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #15161b;
  background-size: 32px 32px;
}

.gallery-intro::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), var(--coral), var(--site-warm));
}

.gallery-intro .eyebrow { color: #aca3ff; }
.gallery-intro .panel-title h1 { color: #fff; }
.gallery-intro .panel-title p { color: rgba(255,255,255,.5); }

.gallery-count-card {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: rgba(255,255,255,.055);
}

.gallery-count-card span,
.gallery-count-card small,
.gallery-selected-meta span {
  color: rgba(255,255,255,.45);
  font-size: 8px;
  font-weight: 820;
}

.gallery-count-card strong {
  font-size: 58px;
  line-height: 1;
  font-weight: 780;
}

.gallery-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.gallery-filter button {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 5px;
  color: rgba(255,255,255,.55);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 760;
}

.gallery-filter button:hover {
  color: #fff;
  border-color: rgba(255,255,255,.28);
}

.gallery-filter button.active {
  color: #15161b;
  border-color: #fff;
  background: #fff;
}

.gallery-selected-meta {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,.11);
}

.gallery-selected-meta b {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-selected-meta small {
  overflow: hidden;
  color: rgba(255,255,255,.46);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-deck {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr) 92px;
  padding: 14px 16px 12px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.9), transparent 42%),
    #e9e8eb;
  overflow: hidden;
}

.gallery-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #5f626a;
  font-size: 8px;
  font-weight: 820;
}

.gallery-main {
  --gallery-drag-x: 0px;
  --gallery-shift-x: 0px;
  --gallery-shift-y: 0px;
  position: relative;
  min-width: 0;
  min-height: 0;
  display: block;
  padding: 0;
  border: 1px solid rgba(20,21,25,.08);
  border-radius: 7px;
  color: #fff;
  text-align: left;
  background: #d9d8dc;
  box-shadow: 0 28px 70px rgba(28,28,34,.14);
  cursor: zoom-in;
  overflow: hidden;
  touch-action: pan-y;
}

.gallery-image-stack {
  position: absolute;
  inset: 0;
  display: block;
  background: #17181d;
  transform: translate3d(var(--gallery-drag-x), 0, 0);
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

.gallery-main.is-dragging {
  cursor: grabbing;
}

.gallery-main.is-dragging .gallery-image-stack {
  transition: none;
}

.gallery-image-layer {
  position: absolute;
  inset: -2%;
  display: block;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: opacity 760ms ease, transform 1050ms cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}

.gallery-deck.is-forward .gallery-image-layer.is-entering {
  transform: translate3d(5%, 0, 0);
}

.gallery-deck.is-backward .gallery-image-layer.is-entering {
  transform: translate3d(-5%, 0, 0);
}

.gallery-image-layer.is-active {
  z-index: 2;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.gallery-deck.is-forward .gallery-image-layer.is-leaving {
  z-index: 1;
  opacity: 0;
  transform: translate3d(-4%, 0, 0);
}

.gallery-deck.is-backward .gallery-image-layer.is-leaving {
  z-index: 1;
  opacity: 0;
  transform: translate3d(4%, 0, 0);
}

.gallery-image-layer img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  will-change: transform;
}

.gallery-image-layer.is-active img.camera-a {
  animation: galleryCameraA 7.2s cubic-bezier(.2,.72,.22,1) both;
}

.gallery-image-layer.is-active img.camera-b {
  animation: galleryCameraB 7.2s cubic-bezier(.2,.72,.22,1) both;
}

@keyframes galleryCameraA {
  0% { transform: translate3d(-1.8%, -1%, 0) scale(1.07); }
  48% { transform: translate3d(.8%, .4%, 0) scale(1.115); }
  100% { transform: translate3d(2.2%, 1%, 0) scale(1.15); }
}

@keyframes galleryCameraB {
  0% { transform: translate3d(2%, 1%, 0) scale(1.14); }
  52% { transform: translate3d(-.6%, -.3%, 0) scale(1.105); }
  100% { transform: translate3d(-2.2%, -1%, 0) scale(1.07); }
}

.gallery-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12,13,17,.16), transparent 36%),
    linear-gradient(0deg, rgba(12,13,17,.46), transparent 45%);
  pointer-events: none;
}

.gallery-display-copy {
  position: absolute;
  z-index: 3;
  top: 9%;
  left: 50%;
  width: min(80%, 900px);
  color: #fff;
  text-align: center;
  transform: translate3d(calc(-50% + var(--gallery-shift-x)), var(--gallery-shift-y), 0);
  transition: transform 360ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.gallery-display-copy small {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,.68);
  font-size: 8px;
  font-weight: 820;
}

.gallery-display-copy strong {
  display: block;
  overflow: hidden;
  font-size: 92px;
  line-height: .9;
  font-weight: 780;
  overflow-wrap: anywhere;
  text-shadow: 0 10px 34px rgba(0,0,0,.22);
  text-wrap: balance;
  white-space: normal;
}

.gallery-deck.is-copy-changing .gallery-display-copy small {
  animation: galleryKickerIn 720ms cubic-bezier(.2,.8,.2,1) both;
}

.gallery-deck.is-copy-changing .gallery-display-copy strong {
  animation: galleryTitleIn 880ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes galleryKickerIn {
  0% { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes galleryTitleIn {
  0% { opacity: 0; transform: translateY(34px); filter: blur(8px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.gallery-vertical-meta {
  position: absolute;
  z-index: 4;
  top: 44px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  writing-mode: vertical-rl;
}

.gallery-vertical-meta b { font-size: 11px; }
.gallery-vertical-meta small { color: rgba(255,255,255,.6); font-size: 7px; font-weight: 780; }

.gallery-route {
  position: absolute;
  z-index: 4;
  bottom: 24%;
  left: 7%;
  width: 36%;
  height: 3px;
  border-radius: 3px;
  background: #7663f2;
  box-shadow: 0 0 22px rgba(118,99,242,.4);
  transform: translate3d(var(--gallery-shift-x), var(--gallery-shift-y), 0) rotate(-5deg);
  transition: transform 420ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.gallery-route::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e4c75f;
  box-shadow: 0 0 0 5px rgba(228,199,95,.2);
  transform: translate(-50%, -50%);
  animation: galleryRouteTravel 4.8s ease-in-out infinite;
}

.gallery-route i {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #7663f2;
  transform: translate(-50%, -50%);
}

.gallery-route i:nth-child(1) { left: 4%; }
.gallery-route i:nth-child(2) { left: 52%; width: 20px; height: 20px; background: #e4c75f; }
.gallery-route i:nth-child(3) { left: 98%; }

.gallery-route i:nth-child(1),
.gallery-route i:nth-child(3) { animation: galleryNodePulse 2.4s ease-in-out infinite; }

.gallery-route i:nth-child(3) { animation-delay: 1.2s; }

@keyframes galleryRouteTravel {
  0% { left: 0; opacity: 0; }
  12%, 88% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes galleryNodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.28); }
  50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}

.gallery-open-mark {
  position: absolute;
  z-index: 5;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #15161b;
  background: #e4c75f;
  box-shadow: 0 12px 30px rgba(34,28,12,.22);
}

.gallery-open-mark svg { width: 18px; height: 18px; }

.gallery-auto-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 7;
  height: 3px;
  background: rgba(255,255,255,.18);
  pointer-events: none;
}

.gallery-auto-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7663f2, #e4c75f, #ef7d93);
  box-shadow: 0 0 16px rgba(118,99,242,.45);
}

.gallery-deck.is-autoplaying .gallery-auto-progress i {
  animation: galleryAutoplayProgress var(--gallery-autoplay-duration, 7s) linear both;
}

@keyframes galleryAutoplayProgress {
  from { width: 0; }
  to { width: 100%; }
}

.gallery-empty-copy {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #70737a;
  text-align: center;
}

.gallery-empty-copy b { color: #303238; font-size: 15px; }
.gallery-empty-copy small { font-size: 9px; }
.gallery-deck.is-empty .gallery-empty-copy { display: grid; }
.gallery-deck.is-empty .gallery-image-stack,
.gallery-deck.is-empty .gallery-wash,
.gallery-deck.is-empty .gallery-display-copy,
.gallery-deck.is-empty .gallery-vertical-meta,
.gallery-deck.is-empty .gallery-route,
.gallery-deck.is-empty .gallery-open-mark,
.gallery-deck.is-empty .gallery-auto-progress { display: none; }

.gallery-navigator {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
}

.gallery-arrows {
  display: flex;
  gap: 6px;
}

.gallery-arrows .icon-button {
  border-color: rgba(20,21,25,.1);
  background: rgba(255,255,255,.7);
}

.gallery-autoplay-toggle[aria-pressed="true"] {
  color: #fff;
  border-color: #7663f2;
  background: #7663f2;
}

.gallery-thumb-track {
  min-width: 0;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.gallery-thumb-track.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.gallery-thumb-track::-webkit-scrollbar { display: none; }

.gallery-thumb {
  position: relative;
  width: 96px;
  height: 58px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  overflow: hidden;
}

.gallery-thumb-media {
  position: absolute;
  inset: 3px;
  display: block;
  overflow: hidden;
  border-radius: 3px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-thumb-index {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 4px;
  border-radius: 3px;
  color: #fff;
  background: rgba(20,21,25,.7);
  font-size: 7px;
  font-weight: 820;
}

.gallery-thumb-copy,
.gallery-thumb-featured {
  display: none;
}

.gallery-thumb.active {
  border-color: #7663f2;
  box-shadow: 0 0 0 2px rgba(118,99,242,.14);
}

.gallery-navigator > strong {
  color: #35373d;
  font-size: 10px;
}

body[data-gallery-card-size="compact"] {
  --gallery-card-width: 148px;
  --gallery-card-height: 102px;
}

body[data-gallery-card-size="balanced"] {
  --gallery-card-width: 182px;
  --gallery-card-height: 124px;
}

body[data-gallery-card-size="large"] {
  --gallery-card-width: 218px;
  --gallery-card-height: 146px;
}

body[data-gallery-layout="habitat"] .gallery-deck {
  grid-template-rows: 34px minmax(0, 1fr) auto;
  padding: 14px 16px 0;
}

body[data-gallery-layout="habitat"] .gallery-main {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

body[data-gallery-layout="habitat"] .gallery-navigator {
  position: relative;
  z-index: 12;
  min-height: calc(var(--gallery-card-height, 124px) + 34px);
  gap: 12px;
  margin: -54px -16px 0;
  padding: 24px 16px 10px;
  border-top: 1px solid rgba(255,255,255,.34);
  background: linear-gradient(180deg, rgba(232,231,235,.1), rgba(232,231,235,.92) 34%, #e8e7eb 72%);
  backdrop-filter: blur(14px);
}

body[data-gallery-layout="habitat"] .gallery-thumb-track {
  align-items: flex-end;
  gap: 12px;
  min-height: calc(var(--gallery-card-height, 124px) + 22px);
  padding: 15px 8px 7px;
  cursor: grab;
}

body[data-gallery-layout="habitat"] .gallery-thumb-track.is-dragging {
  cursor: grabbing;
}

body[data-gallery-layout="habitat"] .gallery-thumb {
  width: var(--gallery-card-width, 182px);
  height: var(--gallery-card-height, 124px);
  padding: 0;
  border-color: rgba(255,255,255,.5);
  border-radius: 7px;
  background: #17181d;
  box-shadow: 0 14px 32px rgba(20,21,26,.2);
  transform: translateY(0) scale(1);
  transform-origin: center bottom;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), border-color 180ms ease, box-shadow 260ms ease, opacity 180ms ease;
}

body[data-gallery-layout="habitat"] .gallery-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 38%, rgba(11,12,16,.82));
  pointer-events: none;
}

body[data-gallery-layout="habitat"] .gallery-thumb-media {
  inset: 0;
  border-radius: 6px;
}

body[data-gallery-layout="habitat"] .gallery-thumb img {
  transition: transform 600ms cubic-bezier(.2,.8,.2,1), filter 260ms ease;
}

body[data-gallery-layout="habitat"] .gallery-thumb:hover {
  border-color: rgba(255,255,255,.92);
  transform: translateY(-5px);
}

body[data-gallery-layout="habitat"] .gallery-thumb:hover img {
  transform: scale(1.045);
}

body[data-gallery-layout="habitat"] .gallery-thumb.active {
  z-index: 4;
  border-color: var(--site-warm);
  box-shadow: 0 18px 38px rgba(20,21,26,.28), 0 0 0 3px color-mix(in srgb, var(--site-warm) 34%, transparent);
  transform: translateY(-11px) scale(1.035);
}

body[data-gallery-layout="habitat"] .gallery-thumb.active img {
  transform: scale(1.055);
}

body[data-gallery-layout="habitat"] .gallery-thumb-copy {
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 10px;
  z-index: 3;
  min-width: 0;
  display: grid;
  gap: 2px;
  color: #fff;
  text-align: left;
}

body[data-gallery-layout="habitat"] .gallery-thumb-copy small,
body[data-gallery-layout="habitat"] .gallery-thumb-copy b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-gallery-layout="habitat"] .gallery-thumb-copy small {
  color: rgba(255,255,255,.62);
  font-size: 7px;
  font-weight: 720;
}

body[data-gallery-layout="habitat"] .gallery-thumb-copy b {
  font-size: 10px;
  font-weight: 820;
}

body[data-gallery-layout="habitat"] .gallery-thumb-index {
  top: 8px;
  right: 8px;
  bottom: auto;
  z-index: 3;
  background: rgba(15,16,20,.62);
  backdrop-filter: blur(8px);
}

body[data-gallery-layout="habitat"] .gallery-thumb-featured {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  min-height: 20px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  color: #17181d;
  background: var(--site-warm);
  font-size: 7px;
  font-weight: 860;
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 11, 15, .78);
  backdrop-filter: blur(18px);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.media-modal.show {
  opacity: 1;
  visibility: visible;
}

.media-dialog {
  min-width: 0;
  width: calc(100vw - 44px);
  max-width: 1180px;
  height: var(--media-dialog-height, calc(100vh - 44px));
  max-height: 900px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: #15161b;
  box-shadow: 0 36px 110px rgba(0,0,0,.46);
  overflow: hidden;
  transform: translateY(12px) scale(.988);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}

.media-modal.show .media-dialog {
  transform: translateY(0) scale(1);
}

.media-dialog-head {
  min-width: 0;
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px 10px 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: #1c1d23;
  overflow: hidden;
}

.media-dialog-head > div:first-child {
  min-width: 0;
  max-width: 100%;
}

.media-dialog-head span,
.media-dialog-head small {
  display: block;
  overflow: hidden;
  color: rgba(255,255,255,.48);
  font-size: 8px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-dialog-head h2 {
  margin: 3px 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-dialog-actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.media-dialog-actions .icon-button {
  color: #fff;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
}

.media-dialog-actions .icon-button:hover {
  background: var(--violet);
}

.media-viewer {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%),
    #0f1014;
  background-size: 26px 26px;
  overflow: hidden;
}

.media-viewer img {
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  align-self: center;
  justify-self: center;
  object-fit: contain;
  object-position: center;
}

.media-viewer.is-error > img { opacity: .18; }

.media-error {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  gap: 12px;
  color: #fff;
  text-align: center;
}

.media-error .ghost-button {
  min-width: 110px;
  color: #17181d;
}

@supports (height: 100dvh) {
  .media-dialog {
    height: var(--media-dialog-height, calc(100dvh - 44px));
  }
}

.wechat-save-tip {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 3;
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  background: rgba(28,29,35,.94);
  box-shadow: 0 18px 48px rgba(0,0,0,.38);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1), visibility 180ms ease;
}

.wechat-save-tip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wechat-save-copy {
  min-width: 0;
}

.wechat-save-tip b,
.wechat-save-tip small {
  display: block;
  letter-spacing: 0;
}

.wechat-save-tip b {
  margin-bottom: 3px;
  font-size: 13px;
}

.wechat-save-tip small {
  color: rgba(255,255,255,.6);
  font-size: 10px;
  line-height: 1.45;
}

.wechat-save-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #15161b;
  background: #fff;
}

.wechat-save-icon svg {
  width: 18px;
  height: 18px;
  animation: wechatHold 1.8s ease-in-out infinite;
}

.wechat-save-tip .icon-button {
  width: 34px;
  height: 34px;
  color: #fff;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
}

.wechat-share-file {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  color: #17181d;
  background: #fff;
  font-size: 11px;
  font-weight: 780;
}

.wechat-share-file:hover {
  background: #e4c75f;
}

.wechat-share-file.disabled {
  opacity: .55;
  pointer-events: none;
}

.wechat-share-file svg {
  width: 15px;
  height: 15px;
}

@keyframes wechatHold {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-2px) scale(1.08); }
}

body.media-open {
  overflow: hidden;
}

.gallery-image-layer.is-image-error {
  background: #22242a;
}

.gallery-image-layer.is-image-error::after {
  content: "图片载入失败 · 点击重试";
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.78);
  background: linear-gradient(145deg, rgba(114,100,243,.2), rgba(20,21,25,.86));
  font-size: 12px;
  font-weight: 760;
}

.gallery-thumb.is-image-error .gallery-thumb-media {
  background: repeating-linear-gradient(135deg, #2a2c33 0 10px, #22242a 10px 20px);
}

.gallery-thumb.is-image-error img { opacity: 0; }

@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 96px minmax(0, 1fr) 340px;
  }

  .tool-panel {
    grid-template-columns: minmax(300px, 340px) minmax(520px, 1fr);
  }
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 13, 17, 0.56);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.profile-modal.show {
  opacity: 1;
  visibility: visible;
}

.profile-card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 36px);
  padding: 27px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: #f7f7f8;
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
  overflow: auto;
  overscroll-behavior: contain;
  transform: translateY(14px) scale(.98);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}

.profile-modal.show .profile-card {
  transform: translateY(0) scale(1);
}

.profile-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(114,100,243,.25);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, var(--violet), var(--coral));
  font-size: 20px;
  font-weight: 840;
}

.profile-copy h2 {
  margin: 6px 0 8px;
  font-size: 24px;
}

.profile-copy p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.profile-auth-mode {
  margin: 4px 0 14px;
  background: #eceef1;
}

.profile-auth-mode button {
  min-height: 40px;
}

.profile-auth-mode button.active {
  color: #fff;
  background: #25272e;
}

.profile-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.profile-field > span {
  color: #555962;
  font-size: 10px;
  font-weight: 780;
}

.profile-field input {
  padding: 0 12px;
  border-color: var(--line);
  background: #fff;
}

.profile-system-id input[readonly] {
  color: #5e626b;
  background:
    repeating-linear-gradient(135deg, rgba(114,100,243,.035) 0 8px, rgba(114,100,243,.075) 8px 9px),
    #f0f1f4;
  cursor: default;
}

.profile-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.publish-modal {
  position: fixed;
  inset: 0;
  z-index: 135;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(11,12,16,.66);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.publish-modal.show {
  opacity: 1;
  visibility: visible;
}

.publish-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 9px;
  color: #17181d;
  background: #f7f7f8;
  box-shadow: 0 32px 90px rgba(0,0,0,.34);
  overflow: auto;
  transform: translateY(14px) scale(.985);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}

.publish-modal.show .publish-card { transform: translateY(0) scale(1); }

.publish-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.publish-card-head h2 {
  margin: 5px 0 0;
  font-size: 23px;
}

.publish-card > p {
  margin: 17px 0;
  color: #646973;
  font-size: 12px;
  line-height: 1.65;
}

.publish-identity {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
}

.publish-identity span { color: var(--muted); }

.publish-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #565b65;
  background: #fff;
  font-size: 12px;
  line-height: 1.55;
  cursor: pointer;
}

.publish-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--violet);
}

.publish-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

body.publish-open { overflow: hidden; }

body.canvas-focus .tool-rail,
body.canvas-focus .control-deck,
body.canvas-focus .result-panel,
body.canvas-focus .hero-strip {
  display: none;
}

body.canvas-focus .workspace {
  grid-template-columns: 1fr;
  min-height: calc(100vh - 90px);
}

body.canvas-focus .tool-panel {
  grid-template-columns: 1fr;
}

body.canvas-focus .tool-surface {
  min-height: calc(100vh - 90px);
}

body.canvas-focus .canvas-deck {
  padding: 22px;
}

body.canvas-focus [data-stage-action="focus"] {
  color: #fff;
  border-color: var(--violet);
  background: var(--violet);
}

@keyframes generationDevelop {
  0%, 100% { filter: grayscale(.42) saturate(.92) contrast(.92) brightness(.92) blur(1.4px); transform: scale(1.025); }
  42%, 72% { filter: grayscale(.04) saturate(1.06) contrast(1.03) brightness(1) blur(0); transform: scale(1.006); }
}

@keyframes generationDepthA {
  0%, 100% { transform: translate3d(-.28%, .18%, 0) scale(1.012); opacity: .05; }
  45%, 72% { transform: translate3d(.22%, -.14%, 0) scale(1.006); opacity: .14; }
}

@keyframes generationDepthB {
  0%, 100% { transform: translate3d(.32%, -.2%, 0) scale(1.014); opacity: .03; }
  38%, 68% { transform: translate3d(-.18%, .16%, 0) scale(1.007); opacity: .09; }
}

@keyframes generationSpectrum {
  0%, 100% { background-position: 130% 0; opacity: .24; }
  50% { background-position: -35% 0; opacity: .64; }
}

@keyframes generationSoftMask {
  0%, 100% { transform: translate3d(-1%, 1%, 0) scale(.98); opacity: .26; }
  50% { transform: translate3d(1%, -1%, 0) scale(1.04); opacity: .52; }
}

@keyframes generationGrain {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(5px, 5px, 0); }
}

@keyframes generationFocus {
  0%, 100% { transform: translate3d(0, 3px, 0) scale(.985); opacity: .5; }
  50% { transform: translate3d(-3px, -2px, 0) scale(1.01); opacity: .82; }
}

@keyframes generationScanX {
  0%, 100% { left: 8%; opacity: .2; }
  50% { left: 92%; opacity: .86; }
}

@keyframes surfaceSweep {
  0%, 42% { transform: translateX(-120%); }
  68%, 100% { transform: translateX(130%); }
}

@keyframes selectionBreathe {
  0%, 100% { opacity: .72; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

@keyframes transferPulse {
  0%, 100% { transform: scale(.94); box-shadow: 0 0 0 7px rgba(114,100,243,.1); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 11px rgba(114,100,243,.16); }
}

@keyframes analysisScan {
  0%, 100% { left: 8%; opacity: .3; }
  50% { left: 92%; opacity: 1; }
}

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

@keyframes resultScan {
  0%, 100% { top: 4%; opacity: .2; }
  50% { top: 96%; opacity: 1; }
}

@keyframes galleryFlow {
  to { transform: translateX(calc(-50% - 4px)); }
}

body[data-motion="calm"] .selection-frame,
body[data-motion="calm"] .analysis-scan,
body[data-motion="calm"] .transfer-line,
body[data-motion="calm"] .dropzone::before {
  animation-duration: 9s;
}

body[data-motion="expressive"] .selection-frame,
body[data-motion="expressive"] .analysis-scan,
body[data-motion="expressive"] .transfer-line,
body[data-motion="expressive"] .dropzone::before {
  animation-duration: 2.4s;
}

body[data-motion="off"] *,
body[data-motion="off"] *::before,
body[data-motion="off"] *::after {
  animation: none !important;
  transition-duration: 0s !important;
}

body[data-theme="graphite"] .control-deck {
  background: #131519;
}

body[data-theme="champagne"] .control-deck {
  background: linear-gradient(155deg, #3a2f2a, #1b1918 62%, #121318);
}

body[data-theme="noir"] .workspace,
body[data-theme="noir"] .tool-surface,
body[data-theme="noir"] .canvas-deck {
  background-color: #1e2025;
}

body[data-surface="pearl"] { background: #f2f1f4; }
body[data-surface="smoke"] { background: #cfd2d7; }

.security-notice-trigger {
  color: #31353d;
}

.security-notice-trigger::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 2px rgba(141, 215, 181, .18);
}

body.safety-open {
  overflow: hidden;
}

.safety-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(11, 12, 16, .62);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.safety-modal.show {
  opacity: 1;
  visibility: visible;
}

.safety-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  color: #17181d;
  background: #f7f7f8;
  box-shadow: 0 32px 90px rgba(0,0,0,.34);
  overflow: auto;
  transform: translateY(14px) scale(.985);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}

.safety-modal.show .safety-card {
  transform: translateY(0) scale(1);
}

.safety-card-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
}

.safety-card-head h2 {
  margin: 4px 0 0;
  font-size: 23px;
  letter-spacing: 0;
}

.safety-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--mint);
  background: #17181d;
}

.safety-mark svg {
  width: 22px;
  height: 22px;
}

.safety-close {
  align-self: start;
}

.safety-intro {
  margin: 18px 0 10px;
  color: #666b74;
  font-size: 12px;
  line-height: 1.65;
}

.safety-notice-list {
  border-top: 1px solid rgba(20,21,25,.1);
  border-bottom: 1px solid rgba(20,21,25,.1);
}

.safety-notice-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  padding: 15px 0;
}

.safety-notice-item + .safety-notice-item {
  border-top: 1px solid rgba(20,21,25,.08);
}

.safety-notice-item > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(114,100,243,.2);
  border-radius: 6px;
  color: var(--violet);
  background: rgba(114,100,243,.07);
}

.safety-notice-item:nth-child(2) > span {
  color: #187f6f;
  border-color: rgba(24,127,111,.2);
  background: rgba(24,127,111,.07);
}

.safety-notice-item svg {
  width: 16px;
  height: 16px;
}

.safety-notice-item div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.safety-notice-item b {
  font-size: 12px;
}

.safety-notice-item small {
  color: #656a74;
  font-size: 11px;
  line-height: 1.65;
}

.safety-commitment {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-top: 14px;
  color: #6b7079;
  font-size: 10px;
  line-height: 1.6;
}

.safety-commitment svg {
  width: 16px;
  height: 16px;
  color: #187f6f;
}

.safety-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.safety-actions .primary-button {
  min-width: 150px;
}

@supports (height: 100dvh) {
  .profile-card,
  .publish-card,
  .safety-card {
    max-height: calc(100dvh - 36px);
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .project-state {
    display: none;
  }

  .workspace {
    grid-template-columns: 74px minmax(0, 1fr) 250px;
  }

  .tool-panel {
    grid-template-columns: minmax(252px, 282px) minmax(360px, 1fr);
  }

  .control-deck {
    padding: 24px 18px 20px;
  }

}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 70px minmax(0, 1fr);
    overflow: visible;
  }

  .tool-rail {
    grid-row: 1 / 3;
  }

  .tool-surface {
    min-height: 650px;
  }

  .result-panel {
    grid-column: 2;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto auto;
    align-items: start;
    overflow: visible;
  }

  .result-panel > .panel-head {
    grid-column: 1 / -1;
  }

  .result-stage {
    grid-column: 1;
    grid-row: 2 / 7;
  }

  .result-inspector,
  .job-details,
  .result-meta,
  .result-actions,
  .history-panel {
    grid-column: 2;
    margin-left: 4px;
  }

  .result-inspector { grid-row: 2; }
  .job-details { grid-row: 3; }
  .result-meta { grid-row: 4; }
  .result-actions { grid-row: 5; }

  .history-panel {
    grid-row: 6;
    max-height: 180px;
    overflow: auto;
  }

  .hero-strip {
    grid-template-columns: 160px minmax(0,1fr);
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .primary-button,
  .ghost-button,
  .user-pill {
    min-height: 44px;
  }

  .canvas-tools .icon-button,
  .canvas-tools .zoom-readout,
  .gallery-arrows .icon-button {
    min-height: 40px;
  }

  .app-shell {
    padding: 0;
  }

  .topbar {
    position: sticky;
    top: 0;
    min-height: 58px;
    padding: 0 10px;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand small,
  .top-badges,
  .user-pill svg {
    display: none;
  }

  .user-pill {
    max-width: 116px;
  }

  .user-pill #userStateText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    display: block;
    min-height: 0;
    border-width: 0 0 1px;
    overflow: visible;
  }

  .tool-rail {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 60;
    height: 58px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(20,21,25,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 14px 42px rgba(20,21,25,.18);
    backdrop-filter: blur(20px);
    overflow: hidden;
    isolation: isolate;
  }

  .rail-label,
  .rail-spacer,
  .rail-focus,
  .tool-index,
  .tool-tab small {
    display: none;
  }

  .tool-tab {
    --tab-accent: #7264f3;
    --tab-soft: rgba(114,100,243,.13);
    min-height: 46px;
    grid-template-columns: auto auto;
    align-content: center;
    margin: 0;
    padding: 0 6px;
    border-radius: 8px;
    background: transparent;
    overflow: hidden;
    transition: color 180ms ease, border-color 180ms ease, transform 140ms ease;
  }

  .tool-tab[data-tool="outpaint"] { --tab-accent: #5d48db; --tab-soft: rgba(93,72,219,.14); }
  .tool-tab[data-tool="match"] { --tab-accent: #b5385c; --tab-soft: rgba(181,56,92,.14); }
  .tool-tab[data-tool="correct"] { --tab-accent: #08766e; --tab-soft: rgba(8,118,110,.14); }
  .tool-tab[data-tool="gallery"] { --tab-accent: #4b5e8a; --tab-soft: rgba(75,94,138,.15); }

  .tool-tab > * {
    position: relative;
    z-index: 2;
  }

  .tool-tab::before {
    top: auto;
    right: 18px;
    bottom: 5px;
    left: 18px;
    width: auto;
    height: 2px;
    z-index: 3;
    border-radius: 2px;
    background: var(--tab-accent);
    opacity: 0;
    transform: scaleX(.25);
    transition: opacity 180ms ease, transform 280ms cubic-bezier(.2,.8,.2,1);
  }

  .tool-tab::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: linear-gradient(110deg, var(--tab-soft) 0 42%, rgba(255,255,255,.72) 50%, var(--tab-soft) 58% 100%);
    background-size: 240% 100%;
    opacity: 0;
    transform: scale(.82);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
  }

  .tool-tab.active {
    color: var(--tab-accent);
    border-color: var(--tab-soft);
    box-shadow: none;
  }

  .tool-tab.active::before {
    opacity: 1;
    transform: scaleX(1);
  }

  .tool-tab.active::after {
    opacity: 1;
    transform: scale(1);
  }

  .tool-tab.tab-activated::after {
    animation: mobileTabSweep 520ms ease-out both;
  }

  .tool-tab.tab-activated svg {
    animation: mobileTabIcon 430ms cubic-bezier(.2,.9,.25,1.25) both;
  }

  .tool-tab.is-pressed {
    transform: scale(.95);
  }

  .tool-tab svg {
    width: 17px;
    height: 17px;
    stroke-width: 2.25;
    filter: drop-shadow(0 4px 8px var(--tab-soft));
  }

  .tool-surface {
    min-height: 0;
    overflow: visible;
  }

  .tool-panel,
  .tool-panel.active {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .tool-panel:not(.active) {
    display: none;
  }

  .control-deck {
    order: 2;
    overflow: visible;
    gap: 14px;
    padding: 18px 18px 22px;
    box-shadow: none;
  }

  .panel-title h1 {
    font-size: 25px;
  }

  .panel-title p {
    max-width: 300px;
  }

  .canvas-deck {
    order: 1;
    min-height: 450px;
    grid-template-rows: 48px 1fr 30px;
    padding: 10px;
  }

  .generation-overlay {
    top: 58px;
    right: 10px;
    bottom: 40px;
    left: 10px;
  }

  .generation-console {
    right: 10px;
    bottom: 10px;
    left: 10px;
    min-height: 86px;
    gap: 8px 10px;
    padding: 11px;
  }

  .generation-console > strong {
    font-size: 20px;
  }

  .generation-focus {
    right: 8%;
    width: 46%;
  }

  .canvas-toolbar small,
  .canvas-tools .icon-button:first-child,
  .canvas-tools .icon-button:nth-child(3) {
    display: none;
  }

  .canvas-toolbar b,
  .canvas-toolbar small,
  .canvas-footer,
  .result-meta,
  .result-empty small {
    font-size: 11px;
  }

  .dropzone,
  .two-upload .dropzone {
    min-height: 400px;
    height: min(68vh, 540px);
  }

  .two-upload {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(280px, 1fr) 32px minmax(280px, 1fr);
    overflow: visible;
  }

  .two-upload .dropzone {
    height: 100%;
    min-height: 280px;
  }

  .transfer-line {
    justify-self: center;
    transform: rotate(90deg);
  }

  .two-upload + .canvas-footer {
    margin-top: 6px;
  }

  .result-panel {
    display: flex;
    padding: 18px 14px 28px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .result-stage {
    width: min(100%, 460px);
    margin: 0 auto;
  }

  .result-inspector,
  .job-details,
  .result-meta,
  .result-actions,
  .history-panel {
    margin-left: 0;
  }

  .result-inspector {
    align-items: stretch;
    flex-direction: column;
  }

  .result-preview-button,
  .result-hold-button { width: 100%; }

  .result-actions {
    flex-wrap: wrap;
  }

  .view-result-button {
    position: fixed;
    right: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 14px;
    z-index: 59;
    width: auto;
    display: inline-flex;
    flex-basis: 100%;
    min-height: 48px;
    color: #fff;
    border-color: rgba(255,255,255,.16);
    background: #202229;
    box-shadow: 0 16px 40px rgba(20,21,25,.28);
  }

  .job-details {
    align-items: flex-start;
    flex-direction: column;
    font-size: 12px;
  }

  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
    font-size: 13px;
  }

  body.has-result-cta .toast {
    bottom: calc(142px + env(safe-area-inset-bottom));
  }

  .history-panel {
    max-height: none;
  }

  .hero-strip {
    grid-template-columns: 1fr;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .exhibition-label {
    min-height: 78px;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-showcase-viewport {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hero-showcase-viewport::-webkit-scrollbar {
    display: none;
  }

  .hero-showcase-track {
    animation: none !important;
  }

  .profile-card {
    padding: 22px 18px;
  }

  .publish-card {
    max-height: calc(100dvh - 36px);
    padding: 20px 16px;
  }

  .publish-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .publish-actions .primary-button,
  .publish-actions .ghost-button { width: 100%; min-height: 46px; }

  .safety-modal {
    padding: 12px;
  }

  .safety-card {
    max-height: calc(100dvh - 24px);
    padding: 20px 16px;
  }

  .safety-card-head {
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    gap: 10px;
  }

  .safety-mark {
    width: 42px;
    height: 42px;
  }

  .safety-card-head h2 {
    font-size: 21px;
  }

  .safety-notice-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 0;
  }

  .safety-notice-item > span {
    width: 30px;
    height: 30px;
  }

  .safety-actions .primary-button {
    width: 100%;
  }

  @supports (height: 100dvh) {
    .safety-card {
      max-height: calc(100dvh - 24px);
    }
  }

  .media-modal {
    padding: 0;
  }

  .media-dialog {
    width: 100%;
    height: var(--media-dialog-height, 100vh);
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .media-dialog-head {
    min-height: 58px;
    padding-top: calc(8px + env(safe-area-inset-top));
  }

  .media-viewer {
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .wechat-save-tip {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
  }

  .wechat-save-icon {
    grid-column: 1;
    grid-row: 1;
  }

  .wechat-save-copy {
    grid-column: 2;
    grid-row: 1;
  }

  .wechat-save-tip > .icon-button {
    grid-column: 3;
    grid-row: 1;
  }

  .wechat-share-file {
    grid-column: 2 / 4;
    grid-row: 2;
    width: 100%;
  }

  body.canvas-focus .topbar {
    display: none;
  }

  body.canvas-focus .tool-rail {
    display: none;
  }

  body.canvas-focus .tool-surface {
    display: block;
  }

  body.canvas-focus .tool-panel.active {
    display: block;
  }

  body.canvas-focus .canvas-deck {
    min-height: 100vh;
    padding: 10px;
  }
}

@keyframes mobileTabSweep {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@keyframes mobileTabIcon {
  0% { transform: translateY(3px) scale(.82); opacity: .55; }
  65% { transform: translateY(-2px) scale(1.12); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tool-tab.tab-activated::after,
  .tool-tab.tab-activated svg,
  .wechat-save-icon svg {
    animation: none !important;
  }
}

/* V25 official examples, privacy copy, stable generation imagery and rewards. */
body.modal-lock { overflow: hidden; }

.official-example {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  background: #e7e8ec;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 180ms ease;
  pointer-events: none;
}

.official-example-pair { grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); }
.official-example-single { display: block; }
.official-example-pane { position: relative; min-width: 0; height: 100%; overflow: hidden; }
.official-example-pane + .official-example-pane { border-left: 1px solid rgba(255,255,255,.82); }

.official-example-pane img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 62% center;
}

.official-example-pane b {
  position: absolute;
  top: 13px;
  left: 13px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  color: #fff;
  background: rgba(19,20,27,.64);
  box-shadow: 0 8px 24px rgba(15,16,22,.14);
  backdrop-filter: blur(10px);
  font-size: 8px;
  line-height: 1;
  letter-spacing: .08em;
}

.official-example > small {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  padding: 5px 7px;
  border-radius: 3px;
  color: rgba(255,255,255,.84);
  background: rgba(18,19,25,.55);
  font-size: 7px;
  font-weight: 820;
  letter-spacing: .08em;
}

.official-example[data-example-module="outpaint"] .is-before img { object-position: 68% center; transform: scale(1.34); }
.official-example[data-example-module="outpaint"] .is-after img { object-position: 57% center; }
.official-example[data-example-module="match"].is-before img { filter: saturate(.56) contrast(.92); }
.official-example[data-example-module="match"].is-after img { filter: saturate(1.08) contrast(1.02); }
.official-example[data-example-module="correct"] .is-before img { filter: saturate(.62) contrast(.88) brightness(.82); }
.official-example[data-example-module="correct"] .is-after img { filter: none; }

.dropzone:not(.has-file) > img[data-preview] { opacity: 0; }
.dropzone.has-file .official-example { opacity: 0; visibility: hidden; }

.upload-privacy {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #747985;
  font-size: 8px;
  line-height: 1.35;
}

.upload-privacy svg { width: 11px; height: 11px; flex: 0 0 auto; color: var(--violet); }
.profile-actions { flex-wrap: wrap; }
.profile-actions #myBadgesButton svg { width: 14px; height: 14px; }

/* The uploaded image remains visually untouched while generation UI is active. */
.generation-overlay {
  color: #17181f;
  background: #dedfe3;
  border-color: rgba(255,255,255,.82);
  box-shadow: 0 26px 70px rgba(18,19,25,.2);
}

.generation-reel { background: #dedfe3; }
.generation-reel::after { background: none; }
.generation-image { object-fit: contain; object-position: center; background: #dedfe3; }
.generation-base,
.generation-developed {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
}

.generation-echo,
.generation-grain { display: none; }

.generation-console {
  color: #181920;
  border-color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.9);
  box-shadow: 0 14px 38px rgba(40,42,52,.16);
}

.generation-copy small { color: rgba(24,25,32,.58); }
.generation-metrics span { color: rgba(24,25,32,.52); }
.generation-progress { background: rgba(30,31,40,.12); }
.generation-steps span { background: rgba(30,31,40,.14); }
.generation-stage-index { color: #fff; text-shadow: 0 3px 14px rgba(0,0,0,.42); }
.generation-stage-index span { color: rgba(255,255,255,.76); }

.welcome-modal,
.badge-award-modal,
.badge-collection-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 48px);
  background: rgba(18,19,26,.48);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.welcome-modal.show,
.badge-award-modal.show,
.badge-collection-modal.show { opacity: 1; visibility: visible; pointer-events: auto; }

.welcome-card,
.badge-award-card,
.badge-collection-card {
  position: relative;
  width: min(100%, 920px);
  max-height: min(88vh, 860px);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background: rgba(249,249,251,.96);
  box-shadow: 0 44px 120px rgba(10,11,18,.28);
  overflow: auto;
  transform: scale(.94) translateY(12px);
  transition: transform 360ms cubic-bezier(.2,.8,.2,1);
}

.show > .welcome-card,
.show > .badge-award-card,
.show > .badge-collection-card { transform: scale(1) translateY(0); }

.welcome-card { padding: clamp(30px, 5vw, 64px); overflow: hidden; }
.welcome-card::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  right: -150px;
  top: -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(114,100,243,.24), rgba(97,216,209,.08) 50%, transparent 72%);
  pointer-events: none;
}

.welcome-close,
.badge-award-close { position: absolute; z-index: 3; top: 18px; right: 18px; }
.welcome-brand { position: relative; display: flex; align-items: center; gap: 12px; }
.welcome-brand .brand-mark { width: 42px; height: 42px; }
.welcome-brand > div { display: grid; gap: 2px; }
.welcome-brand b { font-size: 15px; }
.welcome-brand small { color: var(--muted); font-size: 7px; font-weight: 820; letter-spacing: .12em; }
.welcome-copy { position: relative; width: min(690px, 86%); display: grid; gap: 14px; margin-top: clamp(28px, 5vw, 54px); }
.welcome-copy h2 { margin: 0; max-width: 680px; font-size: clamp(32px, 4.2vw, 58px); line-height: 1.08; letter-spacing: -.045em; }
.welcome-copy p { margin: 0; max-width: 610px; color: #686c76; font-size: clamp(12px, 1.2vw, 15px); line-height: 1.8; }
.welcome-features { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: clamp(28px, 4vw, 46px); }
.welcome-features > div { position: relative; min-height: 116px; display: grid; align-content: end; gap: 4px; padding: 18px; border: 1px solid rgba(24,25,32,.1); border-radius: 10px; background: rgba(255,255,255,.66); overflow: hidden; }
.welcome-features > div > span { position: absolute; top: 12px; right: 13px; color: #a3a6ae; font-size: 8px; font-weight: 820; }
.welcome-features svg { width: 22px; height: 22px; margin-bottom: 7px; color: var(--violet); }
.welcome-features b { font-size: 12px; }
.welcome-features small { color: var(--muted); font-size: 9px; }
.welcome-identity-note { margin: 18px 0 0; color: #858994; font-size: 9px; line-height: 1.6; }
.welcome-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.welcome-actions button { min-height: 42px; }

.badge-award-card { width: min(100%, 620px); padding: clamp(30px, 5vw, 54px); text-align: center; overflow: hidden; }
.badge-ceremony { position: relative; width: min(290px, 72vw); aspect-ratio: 1; display: grid; place-items: center; margin: -10px auto 4px; perspective: 900px; }
.badge-halo { position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, rgba(114,100,243,.3), rgba(97,216,209,.12) 48%, transparent 70%); filter: blur(12px); animation: badgeHalo 4.4s ease-in-out both; }
.badge-medal { position: relative; z-index: 2; width: 66%; aspect-ratio: 1; display: block; transform-style: preserve-3d; animation: badgeCeremony 4.4s cubic-bezier(.2,.8,.2,1) both; }
.badge-medal img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 24px 36px rgba(39,33,83,.28)); }
.badge-medal i { position: absolute; inset: 5%; border-radius: 50%; overflow: hidden; }
.badge-medal i::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -72%; width: 42%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.86), transparent); transform: skewX(-16deg); animation: badgeShine 4.4s ease both; }
.badge-particle { position: absolute; z-index: 1; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 16px currentColor; animation: badgeParticle 3.2s ease-out both; }
.badge-particle.p1 { top: 18%; left: 16%; color: var(--cyan); animation-delay: .25s; }
.badge-particle.p2 { top: 10%; right: 24%; color: var(--site-warm); animation-delay: .5s; }
.badge-particle.p3 { top: 42%; right: 8%; color: var(--coral); animation-delay: .74s; }
.badge-particle.p4 { bottom: 18%; right: 18%; color: var(--cyan); animation-delay: .36s; }
.badge-particle.p5 { bottom: 14%; left: 22%; color: var(--site-warm); animation-delay: .62s; }
.badge-particle.p6 { top: 46%; left: 7%; color: var(--coral); animation-delay: .84s; }
.badge-award-copy { display: grid; gap: 7px; }
.badge-award-copy > p { margin: 4px 0 0; color: #666a74; font-size: 11px; }
.badge-award-copy h2 { margin: 0; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.04em; }
.badge-award-copy small { max-width: 430px; margin: 0 auto; color: #777b85; font-size: 11px; line-height: 1.7; }
.badge-award-actions { display: flex; justify-content: center; gap: 9px; margin-top: 24px; }

.badge-collection-card { width: min(100%, 820px); padding: clamp(24px, 4vw, 42px); }
.badge-collection-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.badge-collection-head h2 { margin: 5px 0; font-size: clamp(28px, 4vw, 42px); }
.badge-collection-head p { margin: 0; color: var(--muted); font-size: 11px; }
.badge-collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 28px; }
.badge-collection-item { min-width: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; align-items: center; padding: 18px; border: 1px solid rgba(24,25,32,.1); border-radius: 12px; background: #fff; }
.badge-collection-icon { display: block; aspect-ratio: 1; }
.badge-collection-icon img { width: 100%; height: 100%; display: block; }
.badge-collection-item > div { min-width: 0; display: grid; gap: 5px; }
.badge-collection-item > div > span { color: var(--violet); font-size: 7px; font-weight: 840; letter-spacing: .1em; }
.badge-collection-item h3 { margin: 0; font-size: 17px; }
.badge-collection-item time { color: #989ba4; font-size: 8px; }
.badge-collection-item p { margin: 3px 0 0; color: #737781; font-size: 10px; line-height: 1.55; }
.badge-empty { min-height: 280px; place-items: center; align-content: center; gap: 8px; margin-top: 22px; color: #969aa4; text-align: center; }
.badge-empty:not([hidden]) { display: grid; }
.badge-empty svg { width: 38px; height: 38px; color: #aaa1ff; }
.badge-empty b { color: #565a64; }
.badge-empty small { max-width: 320px; font-size: 9px; line-height: 1.6; }

@keyframes badgeCeremony {
  0% { opacity: 0; transform: scale(.16) rotateY(-20deg); }
  20% { opacity: 1; transform: scale(1.08) rotateY(0); }
  30% { transform: scale(1) rotateY(0); }
  72% { transform: scale(1) rotateY(720deg); }
  100% { opacity: 1; transform: scale(1) rotateY(720deg); }
}

@keyframes badgeShine {
  0%, 70% { left: -72%; opacity: 0; }
  76% { opacity: 1; }
  94%, 100% { left: 132%; opacity: 0; }
}

@keyframes badgeHalo {
  0% { opacity: 0; transform: scale(.5); }
  28%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes badgeParticle {
  0% { opacity: 0; transform: translateY(24px) scale(.2); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-32px) scale(1.2); }
}

@media (min-width: 1800px) {
  .welcome-card { width: min(1100px, 72vw); }
  .welcome-copy h2 { font-size: clamp(52px, 3vw, 68px); }
}

@media (max-width: 900px) {
  .welcome-modal { display: none !important; }
  .canvas-footer { align-items: center; flex-wrap: wrap; }
  .upload-privacy { flex: 1 1 100%; }
  .badge-collection-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .official-example-pane b { top: 9px; left: 9px; padding: 4px 6px; font-size: 7px; }
  .official-example > small { right: 9px; bottom: 9px; }
  .badge-award-card { padding: 26px 18px 22px; }
  .badge-award-actions { flex-direction: column-reverse; }
  .badge-award-actions button { width: 100%; }
  .badge-collection-card { padding: 22px 16px; }
  .badge-collection-item { grid-template-columns: 74px minmax(0, 1fr); padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .badge-halo,
  .badge-medal,
  .badge-medal i::after,
  .badge-particle { animation: none !important; opacity: 1; transform: none; }
  .badge-particle { display: none; }
  .welcome-card,
  .badge-award-card,
  .badge-collection-card { transition: none; }
}

@media (max-width: 430px) {
  .brand-copy strong {
    font-size: 13px;
  }

  .user-orbit {
    width: 15px;
    height: 15px;
    border-width: 3px;
  }

  .tool-tab {
    padding: 0 5px;
  }

  .tool-tab b {
    font-size: 10px;
  }

  .tool-rail {
    right: 8px;
    left: 8px;
    height: 56px;
  }

  .ratio-grid {
    gap: 4px;
  }

  .control-deck {
    padding-inline: 14px;
  }

  .canvas-deck {
    min-height: 430px;
    padding: 8px;
  }

  .generation-overlay {
    top: 54px;
    right: 8px;
    bottom: 36px;
    left: 8px;
  }

  .generation-copy small {
    max-width: 220px;
  }

  .generation-soft-mask {
    filter: blur(16px);
  }

  .canvas-toolbar b {
    font-size: 8px;
  }

  .dropzone {
    min-height: 320px;
  }

  .two-upload,
  .two-upload .dropzone {
    min-height: 300px;
  }

  .two-upload .drop-copy {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .selection-frame {
    width: 44%;
    right: 7%;
  }

  .drop-copy {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .canvas-footer span:last-child {
    display: none;
  }
}

@media (max-width: 350px) {
  .topbar {
    gap: 8px;
    padding-inline: 8px;
  }

  .top-help {
    display: none;
  }

  .brand {
    max-width: 100%;
  }
}

@media (min-width: 1600px) {
  .workspace.gallery-mode {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .gallery-panel {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .gallery-display-copy strong {
    font-size: 96px;
  }
}

@media (max-width: 1180px) {
  .workspace.gallery-mode {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .gallery-panel {
    grid-template-columns: 258px minmax(0, 1fr);
  }

  .gallery-display-copy strong {
    font-size: 70px;
  }
}

@media (max-width: 980px) {
  .workspace.gallery-mode {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .gallery-panel {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .gallery-intro {
    padding: 22px 16px 18px;
  }

  .gallery-count-card {
    min-height: 126px;
  }

  .gallery-display-copy strong {
    font-size: 56px;
  }
}

@media (max-width: 760px) {
  .tool-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .workspace.gallery-mode {
    display: block;
  }

  .gallery-panel,
  .gallery-panel.active {
    display: flex;
    flex-direction: column;
  }

  .gallery-deck {
    order: 1;
    min-height: 590px;
    grid-template-rows: 30px minmax(440px, 1fr) 88px;
    padding: 10px;
  }

  .gallery-intro {
    order: 2;
    gap: 14px;
    padding: 20px 16px 24px;
  }

  .gallery-intro .panel-title p {
    max-width: 320px;
  }

  .gallery-count-card {
    min-height: 84px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 3px 12px;
  }

  .gallery-count-card strong {
    grid-row: 1 / 3;
    grid-column: 2;
    font-size: 42px;
  }

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

  .gallery-filter button {
    min-height: 36px;
    padding: 0 4px;
  }

  .gallery-selected-meta {
    margin-top: 0;
  }

  .gallery-main {
    min-height: 440px;
  }

  .gallery-display-copy {
    top: 12%;
    width: 88%;
  }

  .gallery-display-copy strong {
    font-size: 44px;
  }

  .gallery-vertical-meta {
    top: 26px;
    right: 8px;
  }

  .gallery-route {
    bottom: 23%;
    left: 8%;
    width: 48%;
  }

  .gallery-open-mark {
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
  }

  .gallery-navigator {
    gap: 8px;
    padding-top: 9px;
  }

  .gallery-arrows {
    display: flex;
  }

  #galleryPrevButton,
  #galleryNextButton {
    display: none;
  }

  .gallery-thumb {
    width: 82px;
    height: 52px;
  }
}

@media (max-width: 430px) {
  .gallery-deck {
    min-height: 540px;
    grid-template-rows: 28px minmax(400px, 1fr) 82px;
    padding: 8px;
  }

  .gallery-main {
    min-height: 400px;
  }

  .gallery-display-copy strong {
    font-size: 38px;
  }

  .gallery-intro {
    padding-inline: 14px;
  }

  .gallery-topline span:nth-child(2) {
    display: none;
  }

  .gallery-navigator > strong {
    font-size: 8px;
  }
}

@media (max-width: 760px) {
  body[data-gallery-card-size="compact"] {
    --gallery-card-width: 112px;
    --gallery-card-height: 78px;
  }

  body[data-gallery-card-size="balanced"] {
    --gallery-card-width: 132px;
    --gallery-card-height: 90px;
  }

  body[data-gallery-card-size="large"] {
    --gallery-card-width: 154px;
    --gallery-card-height: 104px;
  }

  body[data-gallery-layout="habitat"] .gallery-deck {
    min-height: 590px;
    grid-template-rows: 28px minmax(405px, 1fr) auto;
    padding: 8px 8px 0;
  }

  body[data-gallery-layout="habitat"] .gallery-main {
    min-height: 405px;
  }

  body[data-gallery-layout="habitat"] .gallery-navigator {
    min-height: calc(var(--gallery-card-height, 90px) + 28px);
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    margin: -34px -8px 0;
    padding: 17px 8px 7px;
  }

  body[data-gallery-layout="habitat"] .gallery-thumb-track {
    gap: 8px;
    min-height: calc(var(--gallery-card-height, 90px) + 17px);
    padding: 10px 5px 4px;
  }

  body[data-gallery-layout="habitat"] .gallery-thumb.active {
    transform: translateY(-7px) scale(1.025);
  }

  body[data-gallery-layout="habitat"] .gallery-thumb-copy {
    right: 7px;
    bottom: 6px;
    left: 7px;
  }

  body[data-gallery-layout="habitat"] .gallery-thumb-copy small {
    display: none;
  }

  body[data-gallery-layout="habitat"] .gallery-thumb-copy b {
    font-size: 9px;
  }

  body[data-gallery-layout="habitat"] .gallery-thumb-index {
    top: 6px;
    right: 6px;
  }

  body[data-gallery-layout="habitat"] .gallery-thumb-featured {
    top: 6px;
    left: 6px;
    min-height: 18px;
    padding-inline: 5px;
  }
}

@media (max-width: 430px) {
  body[data-gallery-layout="habitat"] .gallery-deck {
    min-height: 548px;
    grid-template-rows: 26px minmax(372px, 1fr) auto;
  }

  body[data-gallery-layout="habitat"] .gallery-main {
    min-height: 372px;
  }

  body[data-gallery-layout="habitat"] .gallery-navigator > strong {
    display: none;
  }
}

@media (max-width: 760px) {
  .generation-aperture {
    top: 14px;
    right: 14px;
    width: 52px;
    height: 52px;
  }

  .generation-stage-index {
    top: 14px;
    left: 14px;
  }

  .generation-stage-index b {
    font-size: 21px;
  }

  .generation-latent-field {
    top: 8%;
    bottom: 31%;
    width: 42px;
  }

  .generation-metrics {
    gap: 7px;
  }

  .generation-metrics strong {
    min-width: 48px;
    font-size: 20px;
  }

  .dropzone:not(.has-file) .drop-copy,
  .two-upload .dropzone:not(.has-file) .drop-copy {
    right: auto;
    bottom: 18px;
    left: 50%;
    min-width: min(210px, calc(100% - 28px));
    transform: translateX(-50%);
  }

  .dropzone:not(.has-file):hover .drop-copy,
  .dropzone.dragging:not(.has-file) .drop-copy {
    transform: translate(-50%, -3px);
  }
}

@media (max-width: 430px) {
  .generation-copy b {
    font-size: 11px;
  }

  .generation-console {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .drop-idle-frame {
    inset: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Habitat exhibition room: one shared, original scene for every work card. */
.gallery-panel,
.gallery-panel.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  color: #29282d;
  background: #ebeae8;
}

.gallery-room {
  --room-card-width: clamp(176px, 20vw, 272px);
  --room-card-gap: clamp(14px, 2.2vw, 30px);
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 15px;
  padding: clamp(20px, 3.1vw, 42px);
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(255,255,255,.98), transparent 29%),
    radial-gradient(circle at 86% 22%, rgba(211,207,237,.6), transparent 32%),
    linear-gradient(154deg, #eeedeb 0%, #e3e1df 54%, #d8d6d4 100%);
}

.gallery-room::before {
  content: "";
  position: absolute;
  z-index: 0;
  right: -12%;
  bottom: -42%;
  left: -12%;
  height: 54%;
  border-top: 1px solid rgba(255,255,255,.72);
  background:
    linear-gradient(115deg, transparent 0 47%, rgba(255,255,255,.32) 47.2% 47.45%, transparent 47.7%),
    linear-gradient(65deg, transparent 0 48%, rgba(126,119,145,.08) 48.2% 48.45%, transparent 48.7%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(166,160,157,.2));
  box-shadow: inset 0 22px 45px rgba(117,108,105,.07);
  transform: perspective(700px) rotateX(57deg);
  transform-origin: top;
  pointer-events: none;
}

.gallery-room::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  right: 8%;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(117,111,126,.16) 28%, rgba(255,255,255,.62) 73%, transparent);
  box-shadow: -22vw 0 0 rgba(255,255,255,.08), 22vw 0 0 rgba(255,255,255,.08);
  pointer-events: none;
}

.gallery-room-light {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.gallery-room-light-a {
  top: -21%;
  left: 27%;
  width: 37%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,255,255,.88), rgba(255,255,255,0) 67%);
}

.gallery-room-light-b {
  right: -8%;
  bottom: 14%;
  width: 34%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(234,215,245,.42), rgba(234,215,245,0) 69%);
}

.gallery-room-header,
.gallery-room-toolbar,
.gallery-room-stage,
.gallery-room-footer {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.gallery-room-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.gallery-room-title {
  min-width: 0;
  max-width: 660px;
}

.gallery-room-title .eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #6c6489;
  font-size: 9px;
  font-weight: 840;
  letter-spacing: .16em;
}

.gallery-room-title h1 {
  margin: 0;
  color: #2c2b31;
  font-size: clamp(26px, 3vw, 43px);
  line-height: .98;
  letter-spacing: -.055em;
}

.gallery-room-title p {
  max-width: 480px;
  margin: 10px 0 0;
  color: #6d6a70;
  font-size: 11px;
  line-height: 1.65;
}

.gallery-room-status {
  min-width: 126px;
  display: grid;
  justify-items: end;
  gap: 1px;
  padding: 8px 0 7px 16px;
  border-left: 1px solid rgba(61,57,67,.16);
  color: #6d6880;
  text-align: right;
}

.gallery-room-status span,
.gallery-room-status small {
  font-size: 8px;
  font-weight: 820;
  letter-spacing: .11em;
}

.gallery-room-status strong {
  color: #36343b;
  font-size: clamp(31px, 4vw, 48px);
  line-height: .92;
  font-variant-numeric: tabular-nums;
}

.gallery-room-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-top: 1px solid rgba(61,57,67,.12);
  border-bottom: 1px solid rgba(61,57,67,.12);
}

.gallery-room .gallery-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gallery-room .gallery-filter button {
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid rgba(61,57,67,.14);
  border-radius: 999px;
  color: #66626b;
  background: rgba(255,255,255,.36);
  font-size: 10px;
  font-weight: 780;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.gallery-room .gallery-filter button:hover,
.gallery-room .gallery-filter button:focus-visible {
  color: #393645;
  border-color: rgba(107,93,163,.44);
  background: rgba(255,255,255,.78);
}

.gallery-room .gallery-filter button.active {
  color: #fff;
  border-color: #70608e;
  background: #70608e;
  box-shadow: 0 6px 15px rgba(83,70,123,.18);
}

.gallery-room .gallery-selected-meta {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 2px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  text-align: right;
}

.gallery-room .gallery-selected-meta span,
.gallery-room .gallery-selected-meta small {
  max-width: min(30vw, 260px);
  overflow: hidden;
  color: #625d69;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-room .gallery-selected-meta b {
  max-width: min(30vw, 260px);
  overflow: hidden;
  color: #38353e;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-room-position {
  flex: 0 0 auto;
  color: #4b4851;
  font-size: 10px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.gallery-room-stage {
  min-height: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.gallery-room-rail {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--room-card-gap);
  padding: 42px clamp(24px, 7vw, 130px) 54px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}

.gallery-room-rail::-webkit-scrollbar { display: none; }
.gallery-room-rail.is-dragging { cursor: grabbing; user-select: none; }

.gallery-room-card {
  --room-active-lift: 0px;
  --room-card-scale: 1;
  position: relative;
  width: var(--room-card-width);
  min-width: var(--room-card-width);
  aspect-ratio: 3 / 4;
  flex: 0 0 auto;
  display: block;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 7px;
  color: #fff;
  background: #f8f7f4;
  box-shadow: 0 18px 30px rgba(55,50,57,.19), 0 44px 58px rgba(63,57,63,.13);
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: center;
  transform: translateY(calc(var(--room-card-rise) + var(--room-active-lift))) rotate(var(--room-card-lean)) scale(var(--room-card-scale));
  transform-origin: center bottom;
  transition: transform 420ms cubic-bezier(.2,.8,.2,1), border-color 220ms ease, box-shadow 420ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease, filter 220ms ease;
}

.gallery-room-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 8px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  pointer-events: none;
}

.gallery-room-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 10%;
  bottom: -14px;
  left: 10%;
  height: 20px;
  border-radius: 50%;
  background: rgba(55,50,57,.34);
  filter: blur(10px);
}

.gallery-room-card:hover {
  --room-active-lift: -10px;
  border-color: #fff;
  box-shadow: 0 24px 38px rgba(55,50,57,.24), 0 52px 68px rgba(63,57,63,.17);
}

.gallery-room-card.active {
  --room-active-lift: -24px;
  --room-card-scale: 1.045;
  z-index: 3;
  border-color: #fff7d7;
  box-shadow: 0 26px 43px rgba(55,50,57,.28), 0 0 0 4px rgba(244,230,174,.26), 0 58px 76px rgba(63,57,63,.2);
}

.gallery-room-card:focus-visible {
  z-index: 4;
  outline: 3px solid #6f5be8;
  outline-offset: 4px;
}

.gallery-room-card-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: linear-gradient(145deg, #b8b5be, #7f7c86);
}

.gallery-room-card-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.13), transparent 36%, rgba(14,12,18,.52));
  pointer-events: none;
}

.gallery-room-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(.2,.8,.2,1), filter 260ms ease, opacity 180ms ease;
}

.gallery-room-card:hover img,
.gallery-room-card.active img { transform: scale(1.055); }

.gallery-room-card-copy {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 16px;
  left: 18px;
  display: grid;
  gap: 3px;
  color: #fff;
  text-align: left;
  text-shadow: 0 3px 11px rgba(0,0,0,.3);
  pointer-events: none;
}

.gallery-room-card-copy small {
  color: rgba(255,255,255,.74);
  font-size: 7px;
  font-weight: 820;
  letter-spacing: .1em;
}

.gallery-room-card-copy b,
.gallery-room-card-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-room-card-copy b { font-size: clamp(12px, 1.2vw, 16px); }
.gallery-room-card-copy em { color: rgba(255,255,255,.68); font-size: 8px; font-style: normal; }

.gallery-room-card-index,
.gallery-room-card-featured {
  position: absolute;
  z-index: 4;
  top: 16px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #36313f;
  background: rgba(255,255,255,.86);
  box-shadow: 0 6px 15px rgba(0,0,0,.12);
  font-size: 8px;
  font-weight: 840;
  backdrop-filter: blur(10px);
}

.gallery-room-card-index { right: 16px; }
.gallery-room-card-featured { left: 16px; color: #473812; background: #f6df9b; }

.gallery-room-card.is-image-error .gallery-room-card-frame {
  background: linear-gradient(145deg, #d9d5dc, #aaa4b2);
}

.gallery-room-card.is-image-error img { opacity: 0; }

.gallery-room-card.is-image-error .gallery-room-card-copy::after {
  content: "图片待重试";
  display: block;
  color: #fff4cb;
  font-size: 8px;
}

.gallery-room-footer {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(61,57,67,.13);
}

.gallery-room-footer .gallery-arrows { display: flex; gap: 6px; }

.gallery-room-footer .icon-button {
  border-color: rgba(61,57,67,.14);
  background: rgba(255,255,255,.56);
  box-shadow: none;
}

.gallery-room-footer .icon-button:hover,
.gallery-room-footer .icon-button:focus-visible {
  border-color: rgba(94,78,145,.48);
  background: #fff;
}

.gallery-room-footer .gallery-autoplay-toggle[aria-pressed="true"] {
  color: #fff;
  border-color: #70608e;
  background: #70608e;
}

.gallery-room-footer button:disabled {
  cursor: not-allowed;
  opacity: .42;
  box-shadow: none;
}

.gallery-open-current {
  justify-self: center;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(61,57,67,.16);
  border-radius: 999px;
  color: #38343f;
  background: rgba(255,255,255,.64);
  box-shadow: 0 7px 18px rgba(60,54,65,.08);
  font-size: 9px;
  font-weight: 820;
}

.gallery-open-current:hover,
.gallery-open-current:focus-visible {
  color: #fff;
  border-color: #70608e;
  background: #70608e;
  box-shadow: 0 10px 22px rgba(83,70,123,.2);
}

.gallery-open-current svg { width: 14px; height: 14px; }

.gallery-room-footer > strong {
  color: #4d4952;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.gallery-room .gallery-auto-progress {
  right: clamp(20px, 3.1vw, 42px);
  bottom: 0;
  left: clamp(20px, 3.1vw, 42px);
  z-index: 2;
  height: 2px;
  background: rgba(86,78,95,.12);
}

.gallery-room .gallery-auto-progress i {
  background: linear-gradient(90deg, #8d7bd7, #d2a86d, #d982a1);
  box-shadow: 0 0 13px rgba(123,105,195,.32);
}

.gallery-room.is-autoplaying .gallery-auto-progress i {
  animation: galleryAutoplayProgress var(--gallery-autoplay-duration, 7s) linear both;
}

.gallery-room .gallery-empty-copy {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #77727c;
  text-align: center;
}

.gallery-room .gallery-empty-copy b { color: #38353e; font-size: 15px; }
.gallery-room .gallery-empty-copy small { font-size: 9px; }
.gallery-room.is-empty .gallery-empty-copy { display: grid; }
.gallery-room.is-empty .gallery-room-rail { opacity: .16; pointer-events: none; }

.gallery-room.is-copy-changing .gallery-room-card.active {
  animation: galleryRoomCardArrive 520ms cubic-bezier(.2,.82,.2,1) both;
}

@keyframes galleryRoomCardArrive {
  0% { opacity: .55; filter: saturate(.82); }
  100% { opacity: 1; filter: saturate(1); }
}

body[data-gallery-card-size="compact"] .gallery-room { --room-card-width: clamp(154px, 17vw, 210px); }
body[data-gallery-card-size="balanced"] .gallery-room { --room-card-width: clamp(176px, 20vw, 272px); }
body[data-gallery-card-size="large"] .gallery-room { --room-card-width: clamp(205px, 23vw, 316px); }

/* Keep the existing setting usable as a quieter, denser alternative. */
body[data-gallery-layout="stage"] .gallery-room {
  background:
    radial-gradient(circle at 50% 8%, rgba(255,255,255,.88), transparent 30%),
    linear-gradient(150deg, #e4e4e6, #d4d3d6);
}

body[data-gallery-layout="stage"] .gallery-room-card:not(.active) {
  --room-card-scale: .94;
  opacity: .74;
  filter: saturate(.82);
}

@media (max-width: 760px) {
  .gallery-panel,
  .gallery-panel.active { display: block; }

  .gallery-room {
    min-height: 630px;
    height: auto;
    gap: 12px;
    padding: 20px 16px 17px;
  }

  .gallery-room-header { gap: 14px; }
  .gallery-room-title h1 { font-size: 30px; }
  .gallery-room-title p { margin-top: 7px; font-size: 10px; }
  .gallery-room-status { min-width: 94px; padding-left: 11px; }
  .gallery-room-status strong { font-size: 34px; }
  .gallery-room-status span,
  .gallery-room-status small { font-size: 7px; }

  .gallery-room-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 9px; padding: 9px 0; }
  .gallery-room .gallery-filter { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .gallery-room .gallery-filter::-webkit-scrollbar { display: none; }
  .gallery-room .gallery-filter button { flex: 0 0 auto; min-height: 30px; padding-inline: 10px; }
  .gallery-room .gallery-selected-meta { justify-items: start; margin: 0; text-align: left; }
  .gallery-room .gallery-selected-meta span,
  .gallery-room .gallery-selected-meta small,
  .gallery-room .gallery-selected-meta b { max-width: 58vw; }
  .gallery-room-position { margin-left: auto; padding-top: 3px; }

  .gallery-room-stage { min-height: 332px; }
  .gallery-room-rail { justify-content: flex-start; gap: 16px; padding: 34px 28px 46px; }
  .gallery-room-card { --room-active-lift: 0px; width: clamp(178px, 56vw, 250px); min-width: clamp(178px, 56vw, 250px); }
  .gallery-room-card.active { --room-active-lift: -14px; }
  .gallery-room-card-copy { right: 16px; bottom: 14px; left: 16px; }
  .gallery-room-card-index,
  .gallery-room-card-featured { top: 14px; min-height: 20px; }
  .gallery-room-card-index { right: 14px; }
  .gallery-room-card-featured { left: 14px; }

  .gallery-room-footer { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding-top: 10px; }
  .gallery-room-footer .gallery-arrows { gap: 4px; }
  .gallery-open-current { min-height: 32px; padding-inline: 11px; }
}

@media (max-width: 430px) {
  .gallery-room { min-height: 594px; padding: 17px 12px 14px; }
  .gallery-room-header { align-items: center; }
  .gallery-room-title h1 { font-size: 27px; }
  .gallery-room-title p { max-width: 245px; font-size: 9px; }
  .gallery-room-status { min-width: 76px; }
  .gallery-room-status strong { font-size: 30px; }
  .gallery-room-status small { display: none; }
  .gallery-room .gallery-selected-meta { max-width: calc(100% - 52px); }
  .gallery-room-position { font-size: 9px; }
  .gallery-room-stage { min-height: 304px; }
  .gallery-room-rail { gap: 13px; padding: 28px 22px 41px; }
  .gallery-room-card { width: min(58vw, 218px); min-width: min(58vw, 218px); }
  .gallery-room-card-copy b { font-size: 12px; }
  .gallery-room-card-copy em { display: none; }
  .gallery-room-footer > strong { display: none; }
  .gallery-open-current { justify-self: end; }
  .gallery-open-current span { display: none; }
  .gallery-open-current svg { width: 15px; height: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-room-rail { scroll-behavior: auto; }
  .gallery-room.is-copy-changing .gallery-room-card.active,
  .gallery-room.is-autoplaying .gallery-auto-progress i {
    animation: none !important;
  }
}

/* V25.1 uploaded media owns the stage ratio; Windows keeps a stable scroll lane. */
.dropzone.has-file {
  width: var(--fitted-stage-width, min(100%, 920px));
  height: var(--fitted-stage-height, min(100%, 560px));
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: var(--media-ratio, auto);
}

.dropzone.has-file > img {
  background-color: #eceef1;
  background-image: none;
}

@media (min-width: 761px) {
  html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
  }

  .workspace {
    min-height: max(688px, calc(100vh - 88px));
  }

  .control-deck {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
  }

  .control-deck .run-button {
    flex: 0 0 48px;
  }
}

@media (max-width: 760px) {
  .dropzone.has-file,
  .two-upload .dropzone.has-file {
    min-height: 0;
  }
}

/* Keep the new import idle state gentle even when the wider site motion is expressive. */
body[data-motion="calm"] .dropzone:not(.has-file) > img { animation-duration: 16s, 10s; }
body[data-motion="calm"] .dropzone:not(.has-file)::before { animation-duration: 10s; }
body[data-motion="expressive"] .dropzone:not(.has-file) > img { animation-duration: 12s, 7.2s; }
body[data-motion="expressive"] .dropzone:not(.has-file)::before { animation-duration: 7.2s; }

/* V23 gallery focus carousel: full source art, a bright glass setting, and a real focal state. */
.user-logout-button {
  color: #665c78;
  border-color: rgba(101,91,124,.18);
  background: rgba(255,255,255,.62);
  box-shadow: 0 8px 20px rgba(75,64,90,.08);
}

.user-logout-button:hover,
.user-logout-button:focus-visible {
  color: #594474;
  border-color: rgba(112,96,142,.48);
  background: rgba(255,255,255,.9);
}

.profile-actions .profile-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: #765766;
}

.profile-actions .profile-logout svg { width: 14px; height: 14px; }

.gallery-screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gallery-room-stage {
  display: grid;
  grid-template-columns: minmax(180px, .58fr) minmax(0, 1.42fr);
  align-items: stretch;
  gap: clamp(16px, 2.7vw, 42px);
  overflow: visible;
}

.gallery-work-detail {
  align-self: center;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 18px clamp(12px, 1.8vw, 25px) 18px 0;
  border-right: 1px solid rgba(91,84,100,.15);
}

.gallery-work-detail::before {
  content: "";
  width: 38px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(116,99,166,.84), rgba(226,178,118,.72));
  box-shadow: 0 3px 12px rgba(131,112,181,.18);
}

.gallery-work-detail-kicker {
  color: #716a81;
  font-size: 8px;
  font-weight: 840;
  letter-spacing: .14em;
}

.gallery-work-detail h2 {
  max-width: 18ch;
  margin: 0;
  color: #33303a;
  font-size: clamp(21px, 2.15vw, 32px);
  line-height: 1.02;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.gallery-work-detail > p {
  max-width: 30ch;
  margin: 0;
  color: #706b75;
  font-size: 10px;
  line-height: 1.7;
}

.gallery-work-facts {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
}

.gallery-work-facts > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.gallery-work-facts dt {
  color: #8c8493;
  font-size: 7px;
  font-weight: 830;
  letter-spacing: .1em;
}

.gallery-work-facts dd {
  min-width: 0;
  margin: 0;
  color: #47424e;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.gallery-work-facts dd span + span {
  display: block;
  margin-top: 1px;
  color: #82758d;
  font-size: 8px;
  font-weight: 740;
}

.gallery-room-carousel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.gallery-room-rail {
  --room-rail-edge: max(24px, calc(50% - var(--room-card-width) / 2));
  height: 100%;
  min-height: 0;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(18px, 3vw, 42px);
  padding: clamp(38px, 5.2vh, 62px) var(--room-rail-edge) clamp(48px, 6vh, 72px);
  scroll-padding-inline: var(--room-rail-edge);
  scroll-snap-stop: always;
  touch-action: pan-y;
}

.gallery-room-card {
  --room-focus-shift: 0px;
  --room-focus-tilt: 0deg;
  --room-card-scale: .84;
  --room-active-lift: 0px;
  width: var(--room-card-width);
  min-width: var(--room-card-width);
  height: auto;
  aspect-ratio: auto;
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  padding: 8px;
  border-color: rgba(255,255,255,.48);
  border-radius: 13px;
  color: #36313e;
  background:
    linear-gradient(145deg, rgba(255,255,255,.56), rgba(238,232,244,.28)),
    rgba(220,215,227,.38);
  box-shadow: 0 16px 35px rgba(79,69,91,.12), 0 35px 66px rgba(100,86,109,.1), inset 0 1px 0 rgba(255,255,255,.7);
  backdrop-filter: blur(16px) saturate(1.08);
  transform: translateX(var(--room-focus-shift)) translateY(calc(var(--room-card-rise) + var(--room-active-lift))) rotate(calc(var(--room-card-lean) + var(--room-focus-tilt))) scale(var(--room-card-scale));
  transform-origin: center bottom;
  transition: transform 520ms cubic-bezier(.18,.83,.18,1), border-color 260ms ease, box-shadow 420ms ease, opacity 300ms ease, filter 360ms ease;
}

.gallery-room-card::before {
  inset: 7px;
  border-color: rgba(255,255,255,.38);
  border-radius: 9px;
}

.gallery-room-card::after {
  z-index: -1;
  bottom: -20px;
  height: 26px;
  background: rgba(107,90,125,.22);
  filter: blur(13px);
}

.gallery-room-card[data-gallery-distance="near"] {
  --room-card-scale: .93;
  opacity: .7;
  filter: saturate(.82) brightness(1.04) blur(.18px);
}

.gallery-room-card[data-gallery-distance="mid"] {
  --room-card-scale: .8;
  opacity: .48;
  filter: saturate(.7) brightness(1.08) blur(.55px);
}

.gallery-room-card[data-gallery-distance="far"] {
  --room-card-scale: .72;
  opacity: .25;
  filter: saturate(.58) brightness(1.12) blur(1.15px);
}

.gallery-room-card.active {
  --room-active-lift: -20px;
  --room-card-scale: 1.12;
  z-index: 4;
  opacity: 1;
  filter: none;
  border-color: rgba(255,249,232,.9);
  background:
    linear-gradient(145deg, rgba(255,255,255,.66), rgba(238,226,244,.38)),
    rgba(222,216,231,.5);
  box-shadow: 0 27px 50px rgba(72,62,84,.19), 0 0 0 4px rgba(255,242,202,.22), 0 56px 84px rgba(104,87,118,.15), inset 0 1px 0 rgba(255,255,255,.78);
  animation: galleryGlassBreath 6.4s ease-in-out infinite;
}

.gallery-room-card:not(.active):hover,
.gallery-room-card:not(.active):focus-visible {
  --room-active-lift: -5px;
  opacity: .85;
  filter: saturate(.92) brightness(1.04);
}

.gallery-room-card.active:hover { --room-active-lift: -23px; }

.gallery-room-card-frame {
  min-height: 0;
  height: auto;
  aspect-ratio: var(--room-media-ratio, 3 / 4);
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 16%, rgba(255,255,255,.72), transparent 38%),
    linear-gradient(145deg, rgba(190,179,210,.7), rgba(210,197,180,.64));
  isolation: isolate;
}

.gallery-room-card-frame::after {
  z-index: 2;
  background: linear-gradient(145deg, rgba(255,255,255,.16), transparent 38%, rgba(238,218,246,.12));
}

.gallery-room-card .gallery-room-card-matte,
.gallery-room-card .gallery-room-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: none;
}

.gallery-room-card .gallery-room-card-matte {
  z-index: 0;
  object-fit: cover;
  opacity: .46;
  filter: blur(22px) saturate(1.15) brightness(1.16);
  transform: scale(1.12);
}

.gallery-room-card .gallery-room-card-image {
  z-index: 1;
  box-sizing: border-box;
  object-fit: contain;
  padding: 4px;
}

.gallery-room-card:hover .gallery-room-card-image,
.gallery-room-card.active .gallery-room-card-image {
  transform: none;
}

.gallery-room-card-copy {
  position: relative;
  z-index: 4;
  right: auto;
  bottom: auto;
  left: auto;
  min-width: 0;
  padding: 10px 8px 7px;
  color: #443e4d;
  text-shadow: none;
}

.gallery-room-card-copy small { color: #82778f; }
.gallery-room-card-copy em { color: #776d80; }

.gallery-room-card-index,
.gallery-room-card-featured {
  z-index: 5;
  color: #53485d;
  background: rgba(255,252,246,.72);
  box-shadow: 0 6px 15px rgba(75,61,89,.1);
}

.gallery-room-card-featured { color: #72521c; background: rgba(249,225,157,.82); }

.gallery-room-card.is-image-error .gallery-room-card-frame {
  background: linear-gradient(145deg, rgba(221,211,231,.88), rgba(207,195,183,.78));
}

.gallery-room-card.is-image-error .gallery-room-card-image,
.gallery-room-card.is-image-error .gallery-room-card-matte { opacity: 0; }

.gallery-room.is-copy-changing .gallery-room-card.active {
  animation: galleryRoomFocusArrive 560ms cubic-bezier(.18,.84,.18,1) both, galleryGlassBreath 6.4s 560ms ease-in-out infinite;
}

@keyframes galleryRoomFocusArrive {
  0% { opacity: .7; filter: saturate(.78) brightness(1.06); }
  100% { opacity: 1; filter: none; }
}

@keyframes galleryGlassBreath {
  0%, 100% { box-shadow: 0 27px 50px rgba(72,62,84,.19), 0 0 0 4px rgba(255,242,202,.19), 0 56px 84px rgba(104,87,118,.13), inset 0 1px 0 rgba(255,255,255,.78); }
  50% { box-shadow: 0 29px 54px rgba(92,76,111,.2), 0 0 0 6px rgba(246,224,255,.28), 0 60px 90px rgba(143,118,169,.17), inset 0 1px 0 rgba(255,255,255,.84); }
}

@media (max-width: 760px) {
  .user-logout-button { min-width: 40px; }

  .gallery-room-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    overflow: visible;
  }

  .gallery-work-detail {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 5px;
    padding: 8px 0 5px;
    border-right: 0;
    border-bottom: 1px solid rgba(91,84,100,.13);
  }

  .gallery-work-detail::before { grid-row: 1 / span 2; align-self: center; width: 2px; height: 36px; }
  .gallery-work-detail-kicker { grid-column: 2; }
  .gallery-work-detail h2 { grid-column: 2; max-width: 100%; font-size: 22px; }
  .gallery-work-detail > p { display: none; }
  .gallery-work-facts { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 4px; }
  .gallery-work-facts dd { font-size: 9px; }
  .gallery-work-facts dd span + span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  body[data-gallery-card-size] .gallery-room,
  .gallery-room { --room-card-width: clamp(164px, 54vw, 248px); }
  .gallery-room-carousel { min-height: 340px; }
  .gallery-room-rail { --room-rail-edge: max(20px, calc(50% - var(--room-card-width) / 2)); min-height: 340px; gap: 19px; padding-block: 38px 53px; }
  .gallery-room-card.active { --room-active-lift: -12px; --room-card-scale: 1.04; }
  .gallery-room-card[data-gallery-distance="near"] { --room-card-scale: .88; opacity: .62; }
  .gallery-room-card[data-gallery-distance="mid"] { --room-card-scale: .76; opacity: .42; }
  .gallery-room-card[data-gallery-distance="far"] { --room-card-scale: .68; opacity: .22; }
  .gallery-room-card-copy { padding: 8px 6px 5px; }
}

@media (max-width: 430px) {
  .gallery-work-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-work-facts > div:last-child { display: none; }
  .gallery-room-carousel,
  .gallery-room-rail { min-height: 306px; }
  .gallery-room-rail { padding-block: 30px 44px; }
  body[data-gallery-card-size] .gallery-room,
  .gallery-room { --room-card-width: min(60vw, 220px); }
  .gallery-room-card-copy em { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-room-card,
  .gallery-room-card .gallery-room-card-matte,
  .gallery-room.is-copy-changing .gallery-room-card.active {
    animation: none !important;
    transition: none !important;
  }

  .gallery-room-card[data-gallery-distance="far"],
  .gallery-room-card[data-gallery-distance="mid"] { filter: saturate(.78) brightness(1.04); }
}

/* Short laptop viewports keep every portrait intact inside the carousel viewport. */
@media (min-width: 761px) and (max-height: 820px) {
  body[data-gallery-card-size] .gallery-room,
  .gallery-room { --room-card-width: clamp(138px, 13.2vw, 152px); }

  .gallery-room-rail { padding-top: 24px; padding-bottom: 34px; }
  .gallery-room-card.active { --room-active-lift: -12px; --room-card-scale: 1.07; }
  .gallery-room-card-copy { padding: 7px 6px 5px; }
  .gallery-room-card-copy b { font-size: 12px; }
  .gallery-work-detail { gap: 8px; padding-block: 10px; }
  .gallery-work-detail > p { font-size: 9px; }
  .gallery-work-facts { gap: 5px; }
}

@media (min-width: 761px) and (max-height: 700px) {
  body[data-gallery-card-size] .gallery-room,
  .gallery-room { --room-card-width: clamp(118px, 11.6vw, 132px); }

  .gallery-room-rail { padding-top: 18px; padding-bottom: 27px; }
  .gallery-room-card.active { --room-active-lift: -8px; --room-card-scale: 1.03; }
  .gallery-room-card-copy small,
  .gallery-room-card-copy em { font-size: 7px; }
  .gallery-work-detail > p { display: none; }
}

/* V24 large-art exhibition: one shared room, real native horizontal scrolling,
   and no decorative card around the work itself. */
body[data-gallery-card-size] .gallery-room,
.gallery-room {
  --room-card-width: clamp(390px, 46vw, 700px);
  --room-card-height: min(clamp(320px, 50vh, 610px), calc(100% - 48px));
}

.gallery-room-stage {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
}

.gallery-room-carousel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: block;
  overflow: hidden;
}

.gallery-room-rail {
  --room-rail-edge: max(16px, calc(50% - var(--room-card-width) / 2));
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(20px, 3.5vw, 58px);
  padding: clamp(14px, 2.5vh, 24px) var(--room-rail-edge);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--room-rail-edge);
  scroll-snap-stop: always;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pinch-zoom;
}

.gallery-room-rail::-webkit-scrollbar { display: none; }
.gallery-room-rail.is-dragging { cursor: grabbing; user-select: none; }

.gallery-room-card {
  --room-focus-shift: 0px;
  --room-focus-tilt: 0deg;
  --room-card-scale: .54;
  --room-card-rise: 0px;
  --room-card-lean: 0deg;
  --room-active-lift: 0px;
  position: relative;
  z-index: 1;
  flex: 0 0 var(--room-card-width);
  width: var(--room-card-width);
  min-width: var(--room-card-width);
  height: var(--room-card-height);
  aspect-ratio: auto;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  cursor: pointer;
  overflow: visible;
  scroll-snap-align: center;
  transform: translateX(var(--room-focus-shift)) translateY(var(--room-active-lift)) rotate(var(--room-focus-tilt)) scale(var(--room-card-scale));
  transform-origin: center;
  transition: transform 620ms cubic-bezier(.2,.82,.2,1), opacity 360ms ease, filter 360ms ease;
}

.gallery-room-card::before,
.gallery-room-card::after { content: none; }

.gallery-room-card[data-gallery-distance="near"] {
  --room-card-scale: .63;
  z-index: 2;
  opacity: .7;
  filter: saturate(.78) brightness(1.06);
}

.gallery-room-card[data-gallery-distance="mid"] {
  --room-card-scale: .48;
  opacity: .34;
  filter: saturate(.58) brightness(1.11) blur(.35px);
}

.gallery-room-card[data-gallery-distance="far"] {
  --room-card-scale: .38;
  opacity: .14;
  filter: saturate(.42) brightness(1.16) blur(.8px);
}

.gallery-room-card.active {
  --room-card-scale: 1;
  z-index: 4;
  opacity: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  animation: none;
}

.gallery-room-card:not(.active):hover,
.gallery-room-card:not(.active):focus-visible {
  --room-active-lift: 0px;
  opacity: .88;
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: saturate(.9) brightness(1.04);
}

.gallery-room-card.active:hover { --room-active-lift: 0px; }

.gallery-room-card:focus-visible {
  z-index: 5;
  outline: 0;
}

.gallery-room-card-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  isolation: auto;
}

.gallery-room-card-frame::after { content: none; }

.gallery-room-card .gallery-room-card-image {
  position: relative;
  inset: auto;
  z-index: 1;
  box-sizing: content-box;
  display: block;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  transform: none;
  transition: box-shadow 900ms ease, filter 420ms ease, opacity 180ms ease;
}

.gallery-room-card:hover .gallery-room-card-image,
.gallery-room-card.active .gallery-room-card-image { transform: none; }

.gallery-room-card.active .gallery-room-card-image {
  animation: galleryArtworkEdgeBreath 4.8s ease-in-out infinite;
}

.gallery-room-card:focus-visible .gallery-room-card-image {
  outline: 3px solid rgba(105,84,214,.85);
  outline-offset: 6px;
}

.gallery-room-card.is-image-error .gallery-room-card-frame { background: transparent; }
.gallery-room-card.is-image-error .gallery-room-card-image { opacity: 0; }

.gallery-room.is-copy-changing .gallery-room-card.active,
.gallery-room.is-copy-changing .gallery-room-card.active .gallery-room-card-image {
  animation: galleryArtworkArrive 540ms cubic-bezier(.2,.82,.2,1) both, galleryArtworkEdgeBreath 4.8s 540ms ease-in-out infinite;
}

@keyframes galleryArtworkArrive {
  0% { opacity: .64; filter: saturate(.78) brightness(1.08); }
  100% { opacity: 1; filter: none; }
}

@keyframes galleryArtworkEdgeBreath {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(93,72,219,.28), 0 22px 50px rgba(70,56,88,.2);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(93,72,219,.4), 0 26px 56px rgba(70,56,88,.24);
  }
}

.gallery-work-detail {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1.1fr) minmax(260px, .9fr);
  align-items: center;
  gap: clamp(10px, 1.6vw, 24px);
  padding: 13px 0 2px;
  border: 0;
  border-top: 1px solid rgba(91,84,100,.15);
}

.gallery-work-detail::before {
  content: "";
  width: 3px;
  height: 38px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(123,104,201,.8), rgba(241,194,123,.76));
  box-shadow: 0 0 14px rgba(146,125,213,.22);
}

.gallery-work-detail-kicker {
  grid-column: 2;
  margin-bottom: -7px;
  color: #5f586c;
  font-size: 10px;
  font-weight: 840;
  letter-spacing: .14em;
}

.gallery-work-copy {
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.gallery-work-detail h2 {
  min-width: 0;
  max-width: 18ch;
  margin: 0;
  overflow: hidden;
  color: #33303a;
  font-size: clamp(17px, 1.75vw, 25px);
  line-height: 1.04;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-work-detail > p,
.gallery-work-copy > p {
  min-width: 0;
  max-width: 42ch;
  margin: 0;
  overflow: hidden;
  color: #5f5a65;
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-work-facts {
  grid-column: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.3vw, 18px);
  margin: 0;
}

.gallery-work-facts > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.gallery-work-facts dt {
  color: #68616f;
  font-size: 10px;
  font-weight: 830;
  letter-spacing: .1em;
}

.gallery-work-facts dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #47424e;
  font-size: 11px;
  font-weight: 730;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-work-facts dd span + span {
  display: inline;
  margin: 0 0 0 4px;
  color: #655d6d;
  font-size: 10px;
  font-weight: 720;
}

.gallery-room-card-copy,
.gallery-room-card-index,
.gallery-room-card-featured,
.gallery-room-card-matte { display: none; }

@media (max-width: 760px) {
  body[data-gallery-card-size] .gallery-room,
  .gallery-room {
    --room-card-width: min(82vw, 480px);
    --room-card-height: clamp(340px, 52svh, 510px);
  }

  .gallery-room-stage { min-height: 0; }
  .gallery-room-carousel,
  .gallery-room-rail { min-height: calc(var(--room-card-height) + 44px); }
  .gallery-room-rail {
    --room-rail-edge: max(12px, calc(50% - var(--room-card-width) / 2));
    gap: 18px;
    padding-block: 22px;
    touch-action: pan-x pinch-zoom;
  }

  .gallery-room-card[data-gallery-distance="near"] { --room-card-scale: .67; opacity: .68; }
  .gallery-room-card[data-gallery-distance="mid"] { --room-card-scale: .52; opacity: .3; }
  .gallery-room-card[data-gallery-distance="far"] { --room-card-scale: .42; opacity: .1; }

  .gallery-work-detail {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px 10px;
    padding-top: 10px;
  }

  .gallery-work-detail::before { grid-row: 1 / span 2; width: 2px; height: 32px; }
  .gallery-work-detail-kicker { grid-column: 2; margin: 0; }
  .gallery-work-copy { grid-column: 2; gap: 7px; }
  .gallery-work-detail h2 { font-size: 18px; }
  .gallery-work-copy > p { display: none; }
  .gallery-work-facts { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 3px; }
}

@media (max-width: 430px) {
  body[data-gallery-card-size] .gallery-room,
  .gallery-room {
    --room-card-width: 84vw;
    --room-card-height: clamp(318px, 50svh, 440px);
  }

  .gallery-work-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-work-facts > div:last-child { display: none; }
}

@media (min-width: 761px) and (max-height: 820px) {
  body[data-gallery-card-size] .gallery-room,
  .gallery-room {
    --room-card-width: clamp(350px, 40vw, 580px);
    --room-card-height: clamp(330px, 45vh, 470px);
  }

  .gallery-room-stage { min-height: min(610px, 70vh); }
  .gallery-room-carousel,
  .gallery-room-rail { min-height: calc(var(--room-card-height) + 44px); }
  .gallery-room-rail { padding-block: 22px; }
  .gallery-work-detail { padding-top: 9px; }
}

/* Put the selected work's copy in the room's unused left space. It overlays
   the scene rather than becoming a column, so it cannot make the art smaller. */
@media (min-width: 1000px) and (min-height: 701px) {
  .gallery-work-detail {
    position: absolute;
    z-index: 6;
    left: clamp(20px, 3.2vw, 48px);
    top: 55%;
    width: min(230px, 19vw);
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px 10px;
    padding: 0;
    border: 0;
    pointer-events: none;
    transform: translateY(-50%);
  }

  .gallery-work-detail::before {
    grid-row: 1 / span 3;
    align-self: center;
    width: 2px;
    height: 46px;
  }

  .gallery-work-detail-kicker,
  .gallery-work-copy,
  .gallery-work-facts { grid-column: 2; }

  .gallery-work-detail-kicker { margin: 0; }
  .gallery-work-copy { display: grid; gap: 6px; }
  .gallery-work-copy > p { display: block; white-space: normal; }
  .gallery-work-facts {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .gallery-work-facts > div {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: baseline;
    gap: 5px;
  }

  .gallery-work-facts dt { font-size: 7px; }
}

/* V27: quality repair and public-work likes */
.repair-mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.repair-guidance { min-height: 70px; }
.settings-note {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
.repair-caution {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid rgba(228,199,95,.3);
  border-radius: 7px;
  color: #6f622c;
  background: rgba(255,249,221,.58);
  font-size: 9px;
  line-height: 1.5;
}
.repair-caution svg { width: 14px; height: 14px; flex: 0 0 auto; }
.stage-repair .stage-label { color: rgba(255,255,255,.88); }
.repair-file-actions [data-clear-file],
.repair-file-actions [data-reselect-file] { opacity: .45; }
.repair-canvas-deck:has(.stage-repair.has-file) .repair-file-actions button { opacity: 1; }
.generation-overlay[data-tool="repair"] { --generation-accent: var(--violet); }
.tool-panel[data-panel="repair"] .generation-image {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

.gallery-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.gallery-sort button {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid rgba(61,57,67,.12);
  border-radius: 999px;
  color: #5f5a65;
  background: rgba(255,255,255,.3);
  font-size: 10px;
  font-weight: 780;
}
.gallery-sort button.active {
  color: #514765;
  border-color: rgba(112,96,142,.36);
  background: rgba(255,255,255,.82);
}
.gallery-like-card {
  position: absolute;
  z-index: 8;
  right: 10px;
  bottom: 10px;
  min-width: 48px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 999px;
  color: #fff;
  background: rgba(25,22,31,.58);
  box-shadow: 0 8px 24px rgba(24,20,34,.2);
  backdrop-filter: blur(10px);
  transition: transform 180ms ease, color 180ms ease, background 180ms ease;
}
.gallery-like-card svg { width: 15px; height: 15px; fill: transparent; }
.gallery-like-card strong { font-size: 9px; font-variant-numeric: tabular-nums; }
.gallery-like-card:hover { transform: scale(1.04); }
.gallery-like-card.is-liked {
  color: #fff;
  background: rgba(225,70,103,.88);
  animation: galleryLikePop 340ms cubic-bezier(.2,.9,.25,1.25);
}
.gallery-like-card.is-liked svg,
.gallery-like-detail.is-liked svg,
.likes-item-remove svg { fill: currentColor; }
.gallery-like-card.is-pending,
.gallery-like-detail.is-pending { opacity: .58; cursor: wait; }
.gallery-like-detail {
  grid-column: 2;
  justify-self: start;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(92,82,108,.18);
  border-radius: 999px;
  color: #625a69;
  background: rgba(255,255,255,.62);
  font-size: 9px;
  font-weight: 800;
  pointer-events: auto;
}
.gallery-like-detail svg { width: 14px; height: 14px; }
.gallery-like-detail strong { font-variant-numeric: tabular-nums; }
.gallery-like-detail.is-liked { color: #d83e64; border-color: rgba(216,62,100,.24); background: rgba(255,238,243,.9); }
.gallery-like-detail:disabled { opacity: .45; }
@keyframes galleryLikePop {
  0% { transform: scale(.82); }
  58% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

.likes-modal {
  position: fixed;
  inset: 0;
  z-index: 94;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12,13,17,.58);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}
.likes-modal.show { opacity: 1; visibility: visible; pointer-events: auto; }
.likes-card {
  width: min(820px, 100%);
  max-height: calc(100vh - 36px);
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  background: #f7f7f8;
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
  overflow: auto;
}
.likes-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.likes-card-head h2 { margin: 6px 0; font-size: 26px; }
.likes-card-head p { margin: 0; color: var(--muted); font-size: 11px; }
.likes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.likes-item { position: relative; min-width: 0; border: 1px solid rgba(24,25,32,.1); border-radius: 8px; background: #fff; overflow: hidden; }
.likes-item-open { width: 100%; display: grid; padding: 0; border: 0; text-align: left; background: transparent; }
.likes-item-open img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #e8e8eb; }
.likes-item-open span { min-width: 0; display: grid; gap: 3px; padding: 11px 52px 12px 12px; }
.likes-item-open b,
.likes-item-open small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.likes-item-open b { color: var(--ink); font-size: 11px; }
.likes-item-open small { color: var(--muted); font-size: 9px; }
.likes-item-remove { position: absolute; right: 9px; bottom: 9px; min-width: 38px; min-height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 999px; color: #d83e64; background: #fff0f4; }
.likes-item-remove svg { width: 13px; height: 13px; }
.likes-item-remove strong { font-size: 8px; }
.likes-empty { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.likes-empty svg { width: 28px; height: 28px; color: #d96a84; }
.likes-empty b { color: var(--ink); font-size: 13px; }
.likes-empty small { font-size: 10px; }

.welcome-features { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .likes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-room-toolbar { flex-wrap: wrap; align-items: center; }
  .gallery-room .gallery-selected-meta { order: 3; width: 100%; justify-items: start; margin-left: 0; text-align: left; }
}

@media (max-width: 760px) {
  .tool-rail { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .repair-file-actions .icon-button:first-child { display: grid; }
  .gallery-room .gallery-filter,
  .gallery-sort { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .gallery-sort::-webkit-scrollbar { display: none; }
  .gallery-room .gallery-filter button,
  .gallery-sort button { min-height: 40px; flex: 0 0 auto; padding-inline: 12px; }
  .gallery-like-card { right: 6px; bottom: 6px; min-width: 52px; min-height: 40px; }
  .gallery-like-detail { grid-column: 1 / -1; min-height: 40px; }
  .welcome-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .likes-grid { grid-template-columns: 1fr; }
  .likes-card { padding: 17px; }
  .repair-mode-switch { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-room-rail { scroll-behavior: auto; }
  .gallery-room-card,
  .gallery-room-card .gallery-room-card-image,
  .gallery-room.is-copy-changing .gallery-room-card.active,
  .gallery-room.is-copy-changing .gallery-room-card.active .gallery-room-card-image {
    animation: none !important;
    transition: none !important;
  }
}

/* V26 gallery alignment: lift the exhibition stage into the visual center and
   temporarily release snap while a selected work is moving to center. */
.gallery-room-rail.is-programmatic-centering {
  scroll-snap-type: none;
}

@media (min-width: 761px) {
  .gallery-room {
    --gallery-stage-rise: clamp(-144px, -11vh, -68px);
  }

  .gallery-room-stage {
    margin-bottom: var(--gallery-stage-rise);
    transform: translateY(var(--gallery-stage-rise));
  }
}

/* V28: deterministic studio feedback, independent repair identity and a
   transform-free gallery focus rail. */
.live-dot.amber {
  background: #d6a84a;
  box-shadow: 0 0 0 4px rgba(214,168,74,.2);
}

.tool-tab[data-tool="repair"] {
  --tab-accent: #b98227;
  --tab-soft: rgba(185,130,39,.16);
}

.tool-tab[data-tool="repair"].active {
  border-color: rgba(185,130,39,.28);
}

.tool-tab[data-tool="repair"].active::before { background: #c59037; }

.repair-panel {
  --repair-accent: #d6a84a;
  --idle-accent: #d6a84a;
}

.repair-panel .dropzone:hover,
.repair-panel .dropzone.dragging { border-color: rgba(185,130,39,.7); }
.repair-panel .dropzone:not(.has-file) .drop-copy > svg { color: #b98227; }
.repair-panel .dropzone:not(.has-file) .drop-copy::after { border-color: rgba(214,168,74,.48); }

.stage-primary { --idle-accent: #7264f3; }
.stage-reference,
.stage-target { --idle-accent: #e76583; }
.stage-correct { --idle-accent: #188d83; }

.idle-ambient {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  opacity: .42;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.idle-ambient::before {
  content: "";
  position: absolute;
  top: -12%;
  bottom: -12%;
  left: -28%;
  width: 24%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--idle-accent, #7264f3) 18%, white), transparent);
  filter: blur(13px);
  transform: skewX(-10deg);
  animation: idleAmbientSweep 7.2s ease-in-out infinite;
}

.idle-ambient::after {
  content: "";
  position: absolute;
  inset: 12% 9% 18%;
  background:
    radial-gradient(circle at 18% 30%, color-mix(in srgb, var(--idle-accent, #7264f3) 13%, transparent), transparent 26%),
    radial-gradient(circle at 78% 68%, rgba(255,255,255,.18), transparent 30%);
  filter: blur(16px);
  animation: idleAmbientBreath 8.4s ease-in-out infinite;
}

.dropzone.has-file .idle-ambient { opacity: 0; }

@keyframes idleAmbientSweep {
  0%, 12% { transform: translateX(0) skewX(-10deg); opacity: 0; }
  28% { opacity: .48; }
  72% { opacity: .3; }
  88%, 100% { transform: translateX(540%) skewX(-10deg); opacity: 0; }
}

@keyframes idleAmbientBreath {
  0%, 100% { opacity: .42; transform: scale(.98); }
  50% { opacity: .78; transform: scale(1.03); }
}

.official-example[data-example-module="repair"] .is-before img {
  filter: saturate(.76) contrast(.84) brightness(.92) blur(.4px);
}

.official-example[data-example-module="repair"] .is-before::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(102deg, transparent 29%, rgba(255,255,255,.22) 30%, transparent 31%),
    repeating-linear-gradient(7deg, transparent 0 58px, rgba(74,56,38,.1) 59px 60px);
  mix-blend-mode: multiply;
  opacity: .72;
}

.official-example[data-example-module="repair"] .is-after img {
  filter: saturate(1.02) contrast(1.035) brightness(1.02);
}

.generation-overlay[data-tool="repair"] { --generation-accent: #d6a84a; }

.generation-overlay.is-indeterminate .generation-development-edge {
  width: 1px;
  background: rgba(255,255,255,.28);
  box-shadow: 0 0 28px 10px color-mix(in srgb, var(--generation-accent) 14%, transparent);
  transition: none;
  animation: generationSweepLeftToRight 3.6s linear infinite;
}

.generation-overlay.is-indeterminate .generation-latent-field {
  opacity: .22;
  transition: none;
  animation: generationSweepLeftToRight 3.6s linear infinite;
}

.generation-overlay.is-indeterminate .generation-latent-field i {
  background: rgba(255,255,255,.16);
  box-shadow: 0 0 13px color-mix(in srgb, var(--generation-accent) 20%, transparent);
}

@keyframes generationSweepLeftToRight {
  0% { left: -64px; opacity: 0; }
  10% { opacity: .16; }
  82% { opacity: .26; }
  100% { left: calc(100% + 8px); opacity: 0; }
}

.gallery-room-rail {
  scroll-snap-type: x proximity;
  scroll-snap-stop: normal;
}

@media (min-width: 761px) {
  .gallery-room { --gallery-stage-rise: 0px; }

  .gallery-room-stage {
    min-height: 0;
    height: 100%;
    margin-bottom: 0;
    overflow: hidden;
    transform: none;
  }

  .gallery-room-carousel {
    min-height: 0;
    height: 100%;
    padding-top: 0;
  }

  .gallery-room-rail {
    min-height: 0;
    height: 100%;
  }
}

/* Tablet and narrow-laptop rooms keep the work detail in the unused left
   margin, instead of letting it consume the carousel's vertical track. */
@media (min-width: 761px) and (max-width: 999px) {
  body[data-gallery-card-size] .gallery-room,
  .gallery-room {
    --room-card-width: clamp(300px, 42vw, 420px);
  }

  .gallery-work-detail {
    position: absolute;
    z-index: 6;
    left: clamp(14px, 2.2vw, 22px);
    top: 55%;
    width: min(138px, 17vw);
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 8px;
    padding: 0;
    border: 0;
    pointer-events: none;
    transform: translateY(-50%);
  }

  .gallery-work-detail::before {
    grid-row: 1 / span 4;
    align-self: center;
    width: 2px;
    height: 42px;
  }

  .gallery-work-detail-kicker,
  .gallery-work-copy,
  .gallery-work-facts,
  .gallery-like-detail { grid-column: 2; }

  .gallery-work-detail-kicker {
    margin: 0;
    font-size: 10px;
    letter-spacing: .04em;
  }
  .gallery-work-copy { display: grid; gap: 4px; }
  .gallery-work-copy > p,
  .gallery-work-facts dt { display: none; }
  .gallery-work-detail h2 { font-size: 17px; }
  .gallery-work-facts { grid-template-columns: 1fr; gap: 4px; }
  .gallery-work-facts > div { display: block; }
  .gallery-work-facts dd { font-size: 11px; }
  .gallery-like-detail {
    min-height: 36px;
    pointer-events: auto;
  }
}

@media (min-width: 761px) and (max-height: 820px) {
  body[data-gallery-card-size] .gallery-room,
  .gallery-room {
    --room-card-width: clamp(300px, 38vw, 500px);
    --room-card-height: clamp(250px, 38vh, 320px);
  }

  .gallery-room-stage,
  .gallery-room-carousel,
  .gallery-room-rail {
    min-height: 0;
  }

  .gallery-room-carousel,
  .gallery-room-rail {
    height: 100%;
  }

  .gallery-room-rail {
    padding-block: clamp(14px, 2.5vh, 20px);
  }
}

@media (max-width: 760px) {
  .tool-tab[data-tool="repair"] { --tab-accent: #835900; --tab-soft: rgba(131,89,0,.16); }
  .gallery-open-current,
  .likes-item-remove { min-height: 40px; }
}

@media (max-width: 520px) {
  .top-help { display: none; }
  .user-pill { max-width: 96px; }
}

@media (max-width: 370px) {
  .brand-copy { display: none; }
}

.tool-panel:not(.active) .idle-ambient::before,
.tool-panel:not(.active) .idle-ambient::after,
.tool-panel:not(.active) .dropzone:not(.has-file)::before,
.tool-panel:not(.active) .drop-copy::after,
.tool-panel:not(.active) .selection-frame,
.tool-panel:not(.active) .analysis-scan,
.tool-panel:not(.active) .transfer-line,
.dropzone.has-file .idle-ambient::before,
.dropzone.has-file .idle-ambient::after,
.generation-overlay:not(.active),
.generation-overlay:not(.active) *,
.tool-panel:not(.active) .generation-overlay,
.tool-panel:not(.active) .generation-overlay * {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .idle-ambient::before,
  .idle-ambient::after,
  .generation-overlay.is-indeterminate .generation-development-edge,
  .generation-overlay.is-indeterminate .generation-latent-field { animation: none !important; }
}

/* V35: configurable modules, shareable LUT artifacts, reward interaction and a clearer development sweep. */
.tool-tab b,
.welcome-features b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-room-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.gallery-share-lut {
  min-height: 38px;
  flex: 0 0 auto;
  border-color: rgba(100,82,166,.24);
  color: #574c72;
  background: rgba(255,255,255,.66);
}

.gallery-share-lut svg { width: 15px; height: 15px; }
.gallery-current-actions { justify-self: center; display: inline-flex; align-items: center; gap: 7px; }
.gallery-download-current { width: 36px; height: 36px; }

.gallery-room-card[data-gallery-asset-type="lut"] .gallery-room-card-frame {
  perspective: 1000px;
}

.gallery-lut-artifact {
  position: relative;
  width: min(88%, 560px);
  max-height: 92%;
  aspect-ratio: 4 / 3;
  display: block;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 20%, rgba(116,99,243,.55), transparent 30%),
    radial-gradient(circle at 18% 82%, rgba(97,216,209,.33), transparent 34%),
    linear-gradient(145deg, #12141c, #202130 58%, #151620);
  box-shadow: 0 26px 70px rgba(37,31,59,.3), inset 0 0 0 1px rgba(255,255,255,.05);
  overflow: hidden;
  transform: rotateX(1deg);
  transition: transform 520ms cubic-bezier(.2,.82,.2,1), box-shadow 520ms ease;
}

.gallery-room-card.active .gallery-lut-artifact {
  animation: galleryArtworkEdgeBreath 4.8s ease-in-out infinite;
}

.gallery-room.is-copy-changing .gallery-room-card.active .gallery-lut-artifact {
  animation: galleryLutArrive 620ms cubic-bezier(.2,.82,.2,1) both, galleryArtworkEdgeBreath 4.8s 620ms ease-in-out infinite;
}

.gallery-lut-spectrum {
  position: absolute;
  inset: 0;
  opacity: .74;
  background:
    linear-gradient(115deg, transparent 6%, rgba(97,216,209,.26) 28%, transparent 48%),
    linear-gradient(128deg, transparent 42%, rgba(114,100,243,.38) 62%, transparent 80%),
    linear-gradient(142deg, transparent 63%, rgba(239,125,147,.27) 83%, transparent 96%);
  filter: saturate(1.18);
}

.gallery-lut-spectrum::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(255,255,255,.055) 20px 21px),
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(255,255,255,.045) 20px 21px);
  mask-image: linear-gradient(135deg, transparent 4%, #000 34%, #000 72%, transparent);
}

.gallery-lut-spectrum i {
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  filter: blur(24px);
  opacity: .46;
}

.gallery-lut-spectrum i:nth-child(1) { top: 7%; left: 12%; color: #61d8d1; }
.gallery-lut-spectrum i:nth-child(2) { top: 30%; right: 17%; color: #7264f3; }
.gallery-lut-spectrum i:nth-child(3) { right: 34%; bottom: 8%; color: #ef7d93; }

.gallery-lut-cube {
  position: absolute;
  top: 18%;
  right: 13%;
  width: 31%;
  aspect-ratio: 1;
  transform: rotate(30deg) skew(-5deg, -5deg);
  transform-style: preserve-3d;
}

.gallery-lut-cube i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 8px;
  box-shadow: inset 0 0 28px rgba(255,255,255,.06), 0 0 30px rgba(114,100,243,.14);
}

.gallery-lut-cube i:nth-child(2) { transform: translate(12px, -12px); opacity: .62; }
.gallery-lut-cube i:nth-child(3) { transform: translate(24px, -24px); opacity: .34; }

.gallery-lut-file {
  position: absolute;
  right: 9%;
  bottom: 10%;
  left: 9%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 4px 12px;
}

.gallery-lut-file b {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: clamp(36px, 5vw, 68px);
  line-height: .82;
  letter-spacing: -.08em;
}

.gallery-lut-file small {
  color: rgba(255,255,255,.72);
  font-size: 9px;
  font-weight: 820;
  letter-spacing: .08em;
}

.gallery-lut-file em {
  min-width: 0;
  overflow: hidden;
  color: rgba(255,255,255,.5);
  font-size: 8px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-room-card[data-gallery-asset-type="lut"] .gallery-like-card { right: 7%; bottom: 7%; }

@keyframes galleryLutArrive {
  0% { opacity: .42; transform: translateY(12px) rotateX(8deg) scale(.92); filter: saturate(.62); }
  100% { opacity: 1; transform: translateY(0) rotateX(1deg) scale(1); filter: none; }
}

.likes-item-lut {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #fff;
  background:
    radial-gradient(circle at 72% 24%, rgba(114,100,243,.7), transparent 31%),
    radial-gradient(circle at 18% 78%, rgba(97,216,209,.46), transparent 36%),
    #171923;
  overflow: hidden;
}

.likes-item-lut::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,.06) 18px 19px);
  pointer-events: none;
}

.likes-item-lut svg { width: 24px; height: 24px; }
.likes-item-lut b { font-size: 20px; letter-spacing: -.04em; }
.likes-item-lut small { color: rgba(255,255,255,.65); font-size: 7px; }
.likes-item-open > .likes-item-lut { padding: 0; }
.likes-item-open .likes-item-copy { min-width: 0; display: grid; gap: 3px; padding: 11px 52px 12px 12px; }

.publish-fields { display: grid; gap: 11px; margin: 14px 0; }
.publish-field { display: grid; gap: 6px; color: #555965; font-size: 10px; font-weight: 790; }
.publish-field input,
.publish-field textarea {
  width: 100%;
  border: 1px solid rgba(24,25,32,.14);
  border-radius: 8px;
  color: #202128;
  background: rgba(255,255,255,.88);
  outline: 0;
}
.publish-field input { min-height: 42px; padding: 0 12px; }
.publish-field textarea { min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.publish-field input:focus,
.publish-field textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(114,100,243,.12); }

/* Animations are scoped to the restart class so they begin when the award is actually shown. */
.badge-halo,
.badge-orbit,
.badge-medal,
.badge-medal i::after,
.badge-particle { animation: none; }

.badge-medal {
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.badge-medal:focus-visible { outline: 3px solid rgba(114,100,243,.6); outline-offset: 7px; }
.badge-medal-face { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transition: transform 180ms cubic-bezier(.2,.8,.2,1); }
.badge-medal-face img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 24px 36px rgba(39,33,83,.28)); }
.badge-medal-face > i { position: absolute; inset: 5%; border-radius: 50%; overflow: hidden; }
.badge-medal-face > i::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -72%; width: 42%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent); transform: skewX(-16deg); }
.badge-award-modal.is-tilting .badge-medal-face { transform: rotateX(var(--badge-tilt-x, 0deg)) rotateY(var(--badge-tilt-y, 0deg)) scale(1.035); }

.badge-orbit {
  position: absolute;
  inset: 12%;
  z-index: 1;
  border: 1px solid rgba(114,100,243,.23);
  border-radius: 50%;
  box-shadow: 0 0 38px rgba(114,100,243,.1);
}
.badge-orbit::before { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 15px var(--cyan); }
.badge-orbit-b { inset: 5%; border-style: dashed; border-color: rgba(239,125,147,.2); }
.badge-orbit-b::before { top: auto; bottom: -3px; background: var(--coral); box-shadow: 0 0 15px var(--coral); }
.badge-particle.p7 { top: 27%; left: 2%; color: var(--site-warm); animation-delay: .42s; }
.badge-particle.p8 { right: 4%; bottom: 34%; color: var(--violet); animation-delay: .68s; }

.badge-award-modal.show.ceremony-restart .badge-halo { animation: badgeHalo 3.2s ease-in-out both; }
.badge-award-modal.show.ceremony-restart .badge-orbit-a { animation: badgeOrbit 4.4s cubic-bezier(.2,.8,.2,1) both; }
.badge-award-modal.show.ceremony-restart .badge-orbit-b { animation: badgeOrbitReverse 5.2s cubic-bezier(.2,.8,.2,1) both; }
.badge-award-modal.show.ceremony-restart .badge-medal { animation: badgeCeremonyV35 2.6s cubic-bezier(.16,.88,.22,1) both; }
.badge-award-modal.show.ceremony-restart .badge-medal-face > i::after { animation: badgeShine 3.1s ease both; }
.badge-award-modal.show.ceremony-restart .badge-particle { animation: badgeParticleV35 2.4s cubic-bezier(.18,.74,.28,1) both; }

@keyframes badgeCeremonyV35 {
  0% { opacity: 0; transform: translateY(24px) scale(.12) rotateY(-80deg); }
  24% { opacity: 1; transform: translateY(-6px) scale(1.12) rotateY(12deg); }
  44% { transform: translateY(0) scale(.96) rotateY(180deg); }
  78% { transform: translateY(-2px) scale(1.035) rotateY(378deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotateY(360deg); }
}
@keyframes badgeOrbit { 0% { opacity: 0; transform: scale(.5) rotate(-140deg); } 28% { opacity: 1; } 100% { opacity: .7; transform: scale(1) rotate(220deg); } }
@keyframes badgeOrbitReverse { 0% { opacity: 0; transform: scale(.65) rotate(180deg); } 30% { opacity: .8; } 100% { opacity: .45; transform: scale(1.04) rotate(-240deg); } }
@keyframes badgeParticleV35 { 0% { opacity: 0; transform: translateY(24px) scale(.1); } 28% { opacity: 1; } 72% { opacity: .8; } 100% { opacity: 0; transform: translateY(-54px) scale(1.45); } }

/* A wider luminous grid makes the left-to-right development pass readable without dimming the source. */
.generation-overlay.is-indeterminate .generation-development-edge {
  width: 2px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 0 4px 1px rgba(255,255,255,.86), 0 0 42px 16px color-mix(in srgb, var(--generation-accent) 44%, transparent);
  animation: generationSweepLeftToRight 2.85s linear infinite;
}
.generation-overlay.is-indeterminate .generation-development-edge::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -46px;
  width: 92px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--generation-accent) 24%, transparent) 58%, rgba(255,255,255,.2) 96%, transparent);
  mix-blend-mode: screen;
}
.generation-overlay.is-indeterminate .generation-development-edge::after {
  content: "";
  position: absolute;
  top: 4%;
  bottom: 21%;
  left: -52px;
  width: 104px;
  background:
    repeating-linear-gradient(0deg, transparent 0 11px, rgba(255,255,255,.34) 11px 12px),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(255,255,255,.24) 12px 13px);
  mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--generation-accent) 52%, transparent));
  opacity: .9;
}
.generation-overlay.is-indeterminate .generation-latent-field {
  width: 84px;
  opacity: .78;
  animation: generationSweepLeftToRight 2.85s linear infinite;
}
.generation-overlay.is-indeterminate .generation-latent-field i {
  width: 2px;
  background: rgba(255,255,255,.52);
  box-shadow: 0 0 16px color-mix(in srgb, var(--generation-accent) 46%, transparent);
}
@keyframes generationSweepLeftToRight {
  0% { left: -104px; opacity: 0; }
  8% { opacity: .58; }
  84% { opacity: .96; }
  100% { left: calc(100% + 12px); opacity: 0; }
}
.result-stage.is-processing::before,
.result-stage.is-image-loading::before {
  height: 2px;
  box-shadow: 0 0 5px 1px rgba(255,255,255,.9), 0 0 34px 12px rgba(114,100,243,.5);
}

@media (max-width: 760px) {
  .gallery-room-header-actions { align-items: flex-end; gap: 7px; }
  .gallery-share-lut { min-height: 40px; padding-inline: 10px; }
  .gallery-share-lut span { display: none; }
  .gallery-lut-artifact { width: min(92%, 470px); }
  .gallery-lut-file b { font-size: clamp(34px, 13vw, 54px); }
  .gallery-current-actions { justify-self: end; }
  .gallery-open-current { justify-self: auto; }
  .gallery-download-current { width: 40px; height: 40px; }
}

@media (max-width: 430px) {
  .gallery-room-header-actions { flex-direction: column-reverse; align-items: flex-end; }
  .gallery-share-lut { min-width: 40px; padding: 0; }
  .gallery-lut-file { right: 8%; bottom: 8%; left: 8%; }
  .gallery-lut-file em { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .badge-award-modal.show.ceremony-restart .badge-halo,
  .badge-award-modal.show.ceremony-restart .badge-orbit,
  .badge-award-modal.show.ceremony-restart .badge-medal,
  .badge-award-modal.show.ceremony-restart .badge-medal-face > i::after,
  .badge-award-modal.show.ceremony-restart .badge-particle,
  .gallery-room-card.active .gallery-lut-artifact,
  .gallery-room.is-copy-changing .gallery-room-card.active .gallery-lut-artifact {
    animation: none !important;
  }
  .badge-orbit,
  .badge-particle { display: none; }
  .badge-medal-face,
  .badge-award-modal.is-tilting .badge-medal-face { transform: none !important; transition: none; }
  .generation-overlay.is-indeterminate .generation-development-edge,
  .generation-overlay.is-indeterminate .generation-latent-field { animation: none !important; }
  .generation-overlay.is-indeterminate .generation-development-edge { left: 50%; opacity: .72; }
}
