/* AI Video Generate Flow gallery */
body.gallery-body {
  --gallery-bg: #080808;
  --gallery-surface: #121214;
  --gallery-surface-strong: #19191c;
  --gallery-line: rgba(255, 255, 255, 0.1);
  --gallery-text: #f8f6f7;
  --gallery-muted: #8f8b91;
  --gallery-pink: #f07ab4;
  --gallery-pink-deep: #d9488f;
  --gallery-lilac: #b48cff;
  --gallery-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-width: 320px;
  color: var(--gallery-text);
  font-family: var(--gallery-font);
  background:
    radial-gradient(circle at 75% -10%, rgba(208, 58, 137, 0.13), transparent 28rem),
    var(--gallery-bg);
}

body.gallery-body::selection {
  color: #fff;
  background: var(--gallery-pink-deep);
}

.gallery-body button,
.gallery-body input,
.gallery-body textarea,
.gallery-body select {
  font: inherit;
}

.gallery-body button,
.gallery-body a {
  -webkit-tap-highlight-color: transparent;
}

.gallery-body button:focus-visible,
.gallery-body a:focus-visible,
.gallery-body input:focus-visible {
  outline: 2px solid var(--gallery-pink);
  outline-offset: 3px;
}

.gallery-body img {
  display: block;
  width: 100%;
}

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

.gallery-app {
  min-height: 100vh;
  overflow: clip;
}

.gallery-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 8, 8, 0.9);
  backdrop-filter: blur(22px);
}

.gallery-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--gallery-text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.gallery-logo {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: var(--gallery-pink);
}

.gallery-logo svg,
.gallery-logo img {
  width: 100%;
  height: 100%;
  overflow: visible;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(240, 122, 180, 0.36));
}

.gallery-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.create-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  background: #171719;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: var(--gallery-pink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.create-button {
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: linear-gradient(135deg, var(--gallery-pink-deep), var(--gallery-pink));
  box-shadow: 0 8px 24px rgba(219, 67, 143, 0.24), inset 0 1px rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.create-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button:hover,
.create-button:hover {
  transform: translateY(-1px);
}

.icon-button:hover {
  border-color: rgba(240, 122, 180, 0.55);
  background: #202024;
}

.gallery-ribbon {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 31px;
  padding: 0 20px;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #df5aa0 0%, #ef87bc 46%, #dda0c4 100%);
}

.ribbon-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 9px rgba(255, 255, 255, 0.8);
}

.ribbon-shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -30%;
  width: 20%;
  transform: skewX(-28deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  animation: ribbon-sweep 7s ease-in-out infinite;
}

@keyframes ribbon-sweep {
  0%, 35% { left: -30%; }
  65%, 100% { left: 120%; }
}

.gallery-main {
  width: min(calc(100% - 24px), 1440px);
  margin: 0 auto;
  padding: 17px 0 42px;
}

.gallery-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
  gap: 32px;
  align-items: end;
  padding: 0 2px 28px;
}

.gallery-kicker,
.gallery-cta p,
.dialog-copy > p {
  margin: 0 0 9px;
  color: var(--gallery-pink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.gallery-intro h1 {
  max-width: 760px;
  margin: 0;
  color: #f4f1f3;
  font-family: var(--gallery-font);
  font-size: clamp(36px, 5vw, 70px);
  font-weight: 740;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.gallery-intro h1 span {
  color: var(--gallery-pink);
  font-weight: 500;
  font-style: italic;
}

.gallery-summary {
  max-width: 410px;
  margin: 0 0 2px auto;
  color: var(--gallery-muted);
  font-size: 14px;
  line-height: 1.65;
}

.gallery-tabs {
  display: flex;
  gap: 25px;
  min-height: 43px;
  margin: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--gallery-line);
  scrollbar-width: none;
}

.gallery-tabs::-webkit-scrollbar,
.gallery-filters::-webkit-scrollbar {
  display: none;
}

.gallery-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0 1px 13px;
  border: 0;
  color: #77737a;
  font-size: 15px;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease;
}

.gallery-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  transform: scaleX(0);
  border-radius: 2px 2px 0 0;
  background: var(--gallery-pink);
  content: "";
  transition: transform 180ms ease;
}

.gallery-tab:hover,
.gallery-tab.is-active {
  color: #fff;
}

.gallery-tab.is-active::after {
  transform: scaleX(1);
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 0 10px;
  scroll-margin-top: 112px;
}

.gallery-search {
  display: flex;
  align-items: center;
  width: 42px;
  min-width: 42px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--gallery-line);
  border-radius: 9px;
  color: #8a858d;
  background: #111113;
  cursor: text;
  transition: width 240ms ease, border-color 180ms ease, background 180ms ease;
}

.gallery-search:focus-within,
.gallery-search:hover {
  width: 224px;
  border-color: rgba(240, 122, 180, 0.4);
  background: #151518;
}

.gallery-search svg {
  width: 18px;
  min-width: 18px;
  margin: 0 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.gallery-search input {
  width: 126px;
  min-width: 126px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 12px;
  background: transparent;
}

.gallery-search input::placeholder {
  color: #6e6971;
}

.gallery-search kbd {
  display: grid;
  width: 21px;
  height: 21px;
  margin: 0 8px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: #68636b;
  font-size: 10px;
  background: #0c0c0d;
}

.gallery-filters {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 15px;
  flex: 0 0 auto;
  border: 1px solid var(--gallery-line);
  border-radius: 9px;
  color: #a39fa5;
  font-size: 12px;
  font-weight: 700;
  background: #111113;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.filter-chip svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.filter-chip:hover {
  color: #fff;
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-chip.is-active {
  border-color: rgba(240, 122, 180, 0.4);
  color: #fff;
  background: linear-gradient(180deg, #282329, #1b181d);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 18px rgba(218, 65, 142, 0.08);
}

.gallery-grid {
  columns: 4 280px;
  column-gap: 12px;
}

.gallery-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.gallery-card[hidden] {
  display: none;
}

.gallery-card-open {
  position: relative;
  display: block;
  width: 100%;
  height: 370px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  color: #fff;
  text-align: left;
  background: #171719;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), border-color 220ms ease, box-shadow 220ms ease;
}

.gallery-card--short .gallery-card-open {
  height: 292px;
}

.gallery-card--tall .gallery-card-open {
  height: 444px;
}

.gallery-card-open > img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  filter: saturate(0.9) contrast(1.02);
  transition: transform 700ms cubic-bezier(.15,.8,.2,1), filter 260ms ease;
}

.gallery-card-open::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.gallery-card-open:hover {
  z-index: 2;
  transform: translateY(-3px);
  border-color: rgba(240, 122, 180, 0.5);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(240, 122, 180, 0.06);
}

.gallery-card-open:hover > img {
  transform: scale(1.055);
  filter: saturate(1) contrast(1.03);
}

.card-glow {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(180deg, transparent, rgba(5, 4, 5, 0.16) 18%, rgba(5, 4, 5, 0.91) 100%);
}

.card-index {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  min-width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: rgba(8, 8, 9, 0.34);
  backdrop-filter: blur(10px);
}

.card-save {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  transform: translateY(-6px);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  opacity: 0;
  background: rgba(8, 8, 9, 0.42);
  backdrop-filter: blur(10px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.gallery-card-open:hover .card-save {
  transform: translateY(0);
  opacity: 1;
}

.card-save svg {
  width: 15px;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.card-content {
  position: absolute;
  right: 17px;
  bottom: 16px;
  left: 17px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-shadow: 0 1px 13px rgba(0, 0, 0, 0.65);
}

.card-content strong {
  display: block;
  max-width: 95%;
  margin: 0 0 3px;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-content small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
}

.card-tag,
.card-meta {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-shadow: none;
}

.card-tag--hot {
  background: linear-gradient(135deg, #d9438e, #f07ab4);
}

.card-tag--new {
  background: linear-gradient(135deg, #e06352, #ef8a68);
}

.card-tag--violet {
  background: linear-gradient(135deg, #6b53b8, #a77cea);
}

.card-tag--blue {
  background: linear-gradient(135deg, #3e77b0, #65a6d8);
}

.card-meta {
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}

.gallery-empty {
  padding: 80px 20px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: #0e0e10;
}

.gallery-empty > span {
  color: var(--gallery-pink);
  font-size: 34px;
}

.gallery-empty h2 {
  margin: 12px 0 5px;
  color: #fff;
  font-family: var(--gallery-font);
  font-size: 24px;
}

.gallery-empty p {
  margin: 0 0 20px;
  color: var(--gallery-muted);
  font-size: 13px;
}

.gallery-empty button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(240, 122, 180, 0.35);
  border-radius: 8px;
  color: #fff;
  background: #1b171b;
  cursor: pointer;
}

.gallery-cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  margin-top: 48px;
  padding: clamp(28px, 5vw, 70px);
  overflow: hidden;
  border: 1px solid rgba(240, 122, 180, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(circle at 75% 10%, rgba(240, 122, 180, 0.26), transparent 22rem),
    linear-gradient(135deg, #191117, #0e0d10 65%);
}

.gallery-cta::before {
  position: absolute;
  top: -85px;
  right: -45px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(255, 255, 255, 0.02), 0 0 0 64px rgba(255, 255, 255, 0.012);
  content: "";
}

.gallery-cta h2 {
  position: relative;
  max-width: 780px;
  margin: 0;
  color: #fff;
  font-family: var(--gallery-font);
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.gallery-cta > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 50px;
  padding: 0 19px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: linear-gradient(135deg, var(--gallery-pink-deep), var(--gallery-pink));
  box-shadow: 0 12px 30px rgba(217, 72, 143, 0.22);
}

.gallery-cta > a span {
  font-size: 18px;
}

.gallery-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 34px;
  padding: 26px 2px 0;
  border-top: 1px solid var(--gallery-line);
  color: #706c72;
  font-size: 11px;
}

.gallery-brand--small {
  color: #d9d5d8;
  font-size: 15px;
}

.gallery-brand--small .gallery-logo {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  font-size: 17px;
}

.gallery-footer p {
  margin: 0;
  text-align: center;
}

.gallery-footer > div {
  display: flex;
  gap: 17px;
}

.gallery-footer > div a {
  color: #89858b;
  text-decoration: none;
}

.gallery-footer > div a:hover {
  color: #fff;
}

.mobile-gallery-nav {
  display: none;
}

.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 28px;
}

.gallery-pagination-pages {
  display: contents;
}

.gallery-pagination button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--gallery-line);
  border-radius: 8px;
  color: #aaa5ad;
  background: #111113;
  cursor: pointer;
}

.gallery-pagination button:hover,
.gallery-pagination button.is-active {
  border-color: rgba(240, 122, 180, 0.46);
  color: #fff;
  background: #251c22;
}

.gallery-pagination button:disabled {
  color: #48454a;
  cursor: not-allowed;
}

.gallery-pagination span {
  color: #5f5a62;
}

.gallery-dialog {
  width: min(calc(100% - 32px), 920px);
  max-width: none;
  height: min(78vh, 640px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: #fff;
  background: #111113;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}

.gallery-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  animation: dialog-in 220ms cubic-bezier(.2,.8,.2,1);
}

.gallery-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0 0 2px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  background: rgba(8, 8, 9, 0.62);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.dialog-image-wrap {
  min-height: 0;
  background: #0b0b0c;
}

.dialog-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 38px 32px;
  background:
    radial-gradient(circle at 100% 0, rgba(240, 122, 180, 0.16), transparent 18rem),
    #111113;
}

.dialog-copy h2 {
  margin: 0 0 7px;
  color: #fff;
  font-family: var(--gallery-font);
  font-size: clamp(28px, 4vw, 45px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.dialog-copy > span {
  color: var(--gallery-muted);
  font-size: 13px;
}

.dialog-actions {
  display: grid;
  gap: 9px;
  margin-top: 25px;
}

.dialog-copy button,
.dialog-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gallery-pink-deep), var(--gallery-pink));
  cursor: pointer;
}

.dialog-download {
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  background: #1a191c;
}

.dialog-copy button span,
.dialog-download span {
  font-size: 18px;
}

.upload-dialog {
  width: min(calc(100% - 32px), 620px);
  max-width: none;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(240, 122, 180, 0.16), transparent 20rem),
    #111113;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72);
}

.upload-dialog[open] {
  animation: dialog-in 220ms cubic-bezier(.2,.8,.2,1);
}

.upload-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}

.upload-heading span {
  color: var(--gallery-pink);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.upload-heading h2 {
  margin: 8px 0 7px;
  color: #fff;
  font-size: 32px;
  letter-spacing: -0.045em;
}

.upload-heading p {
  max-width: 480px;
  margin: 0;
  color: var(--gallery-muted);
  font-size: 12px;
  line-height: 1.6;
}

.upload-dropzone {
  display: flex;
  min-height: 230px;
  margin-top: 23px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(240, 122, 180, 0.4);
  border-radius: 15px;
  color: #fff;
  background: rgba(240, 122, 180, 0.045);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
  transform: translateY(-1px);
  border-color: var(--gallery-pink);
  background: rgba(240, 122, 180, 0.09);
}

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

.upload-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid rgba(240, 122, 180, 0.38);
  border-radius: 50%;
  color: var(--gallery-pink);
  font-size: 24px;
  background: rgba(240, 122, 180, 0.08);
}

.upload-dropzone strong {
  font-size: 15px;
}

.upload-dropzone small {
  margin-top: 6px;
  color: var(--gallery-muted);
  font-size: 10px;
}

.upload-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 23px;
  padding: 12px;
  border: 1px solid var(--gallery-line);
  border-radius: 14px;
  background: #0b0b0c;
}

.upload-preview[hidden] {
  display: none;
}

.upload-preview img {
  width: 160px;
  height: 160px;
  border-radius: 10px;
  object-fit: cover;
}

.upload-preview label {
  display: grid;
  gap: 8px;
  color: #b8b3ba;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.upload-preview input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--gallery-line);
  border-radius: 8px;
  outline: 0;
  color: #fff;
  font-size: 13px;
  text-transform: none;
  background: #171719;
}

.upload-preview input:focus {
  border-color: rgba(240, 122, 180, 0.55);
}

.upload-preview p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: #6f6a72;
  font-size: 10px;
  line-height: 1.5;
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 19px;
}

.upload-actions button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.upload-secondary {
  border: 1px solid var(--gallery-line);
  background: #18181a;
}

.upload-primary {
  border: 0;
  background: linear-gradient(135deg, var(--gallery-pink-deep), var(--gallery-pink));
}

.upload-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gallery-card--local .gallery-card-open {
  border-color: rgba(240, 122, 180, 0.48);
  box-shadow: 0 0 0 1px rgba(240, 122, 180, 0.06), 0 16px 36px rgba(0, 0, 0, 0.35);
}

.legal-main {
  width: min(calc(100% - 32px), 920px);
  margin: 0 auto;
  padding: 64px 0 80px;
}

.legal-main > header {
  max-width: 760px;
  margin-bottom: 42px;
}

.legal-main .legal-kicker {
  margin: 0 0 12px;
  color: var(--gallery-pink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.legal-main h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.legal-main .legal-lead {
  margin: 20px 0 0;
  color: #a19ca4;
  font-size: 15px;
  line-height: 1.7;
}

.legal-sections {
  display: grid;
  gap: 12px;
}

.legal-sections section {
  padding: 24px;
  border: 1px solid var(--gallery-line);
  border-radius: 14px;
  background: #101012;
}

.legal-sections h2 {
  margin: 0 0 10px;
  color: #f5f2f4;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.legal-sections p,
.legal-sections li {
  color: #8f8a92;
  font-size: 13px;
  line-height: 1.75;
}

.legal-sections p {
  margin: 0;
}

.legal-sections ul {
  margin: 0;
  padding-left: 20px;
}

.legal-back {
  display: inline-flex;
  margin-top: 30px;
  color: var(--gallery-pink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.gallery-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(360px, calc(100% - 40px));
  padding: 11px 15px;
  transform: translateY(20px);
  border: 1px solid rgba(240, 122, 180, 0.28);
  border-radius: 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  background: rgba(25, 20, 25, 0.94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.gallery-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .gallery-grid {
    columns: 3 230px;
  }

  .gallery-card-open {
    height: 340px;
  }

  .gallery-card--short .gallery-card-open {
    height: 270px;
  }

  .gallery-card--tall .gallery-card-open {
    height: 400px;
  }

  .gallery-cta {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .gallery-cta > a {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  body.gallery-body {
    padding-bottom: 66px;
  }

  .gallery-header {
    min-height: 58px;
    padding: 0 15px;
  }

  .gallery-brand {
    font-size: 18px;
  }

  .gallery-logo {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }

  .icon-button {
    display: none;
  }

  .create-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 11px;
  }

  .create-button svg {
    width: 15px;
  }

  .gallery-ribbon {
    height: 28px;
    padding: 0 15px;
    font-size: 9px;
  }

  .gallery-main {
    width: min(calc(100% - 22px), 1440px);
    padding-top: 14px;
  }

  .gallery-intro {
    grid-template-columns: 1fr;
    gap: 13px;
    padding-bottom: 23px;
  }

  .gallery-intro h1 {
    font-size: clamp(37px, 12vw, 56px);
  }

  .gallery-summary {
    max-width: 520px;
    margin: 0;
    font-size: 12px;
  }

  .gallery-tabs {
    gap: 21px;
    min-height: 45px;
  }

  .gallery-tab {
    padding-bottom: 13px;
    font-size: 13px;
  }

  .gallery-toolbar {
    display: block;
    padding: 13px 0 12px;
  }

  .gallery-search,
  .gallery-search:hover,
  .gallery-search:focus-within {
    width: 100%;
    height: 41px;
    margin-bottom: 9px;
  }

  .gallery-search input {
    width: 100%;
    min-width: 0;
  }

  .gallery-filters {
    margin: 0 -11px;
    padding: 0 11px;
  }

  .filter-chip {
    min-height: 36px;
    padding: 0 13px;
    font-size: 11px;
  }

  .gallery-grid {
    columns: 2 150px;
    column-gap: 8px;
  }

  .gallery-card {
    margin-bottom: 8px;
  }

  .gallery-card-open,
  .gallery-card--short .gallery-card-open,
  .gallery-card--tall .gallery-card-open {
    height: 300px;
    border-radius: 10px;
  }

  .gallery-card--short .gallery-card-open {
    height: 222px;
  }

  .gallery-card--tall .gallery-card-open {
    height: 354px;
  }

  .card-index {
    top: 8px;
    left: 8px;
    min-width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 8px;
  }

  .card-save {
    display: none;
  }

  .card-content {
    right: 11px;
    bottom: 11px;
    left: 11px;
  }

  .card-content strong {
    font-size: 13px;
  }

  .card-content small {
    font-size: 9px;
  }

  .card-badges {
    margin-top: 7px;
  }

  .card-tag,
  .card-meta {
    min-height: 20px;
    padding: 0 6px;
    font-size: 7px;
  }

  .gallery-cta {
    margin-top: 30px;
    padding: 27px 22px;
    border-radius: 15px;
  }

  .gallery-cta h2 {
    font-size: 31px;
  }

  .gallery-cta > a {
    min-height: 44px;
    font-size: 11px;
  }

  .gallery-footer {
    grid-template-columns: 1fr;
    padding-bottom: 15px;
    text-align: center;
  }

  .gallery-footer .gallery-brand,
  .gallery-footer > div {
    justify-content: center;
  }

  .gallery-footer p {
    order: 3;
  }

  .mobile-gallery-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 64px;
    padding: 6px max(9px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(11, 11, 12, 0.95);
    backdrop-filter: blur(20px);
  }

  .mobile-gallery-nav a,
  .mobile-gallery-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: #77727a;
    border: 0;
    font-size: 8px;
    font-weight: 700;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
  }

  .mobile-gallery-nav a span,
  .mobile-gallery-nav button span {
    color: #aaa5ad;
    font-size: 20px;
    line-height: 1;
  }

  .mobile-gallery-nav a.is-active,
  .mobile-gallery-nav a.is-active span {
    color: var(--gallery-pink);
  }

  .gallery-dialog {
    width: calc(100% - 22px);
    height: min(86vh, 730px);
  }

  .gallery-dialog[open] {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .dialog-copy {
    padding: 22px 19px 19px;
  }

  .dialog-copy h2 {
    font-size: 29px;
  }

  .dialog-copy button {
    margin-top: 0;
  }

  .dialog-actions {
    margin-top: 16px;
  }

  .upload-dialog {
    width: calc(100% - 22px);
    padding: 24px 17px 17px;
    border-radius: 16px;
  }

  .upload-heading h2 {
    font-size: 27px;
  }

  .upload-dropzone {
    min-height: 205px;
  }

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

  .upload-preview img {
    width: 100px;
    height: 120px;
  }

  .gallery-pagination {
    gap: 5px;
    margin-top: 20px;
  }

  .gallery-pagination button {
    width: 31px;
    height: 31px;
    font-size: 10px;
  }

  .legal-main {
    width: min(calc(100% - 24px), 920px);
    padding: 42px 0 60px;
  }

  .legal-main > header {
    margin-bottom: 28px;
  }

  .legal-sections section {
    padding: 19px;
  }

  .gallery-toast {
    right: 11px;
    bottom: 76px;
    left: 11px;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .create-button span {
    display: none;
  }

  .create-button {
    width: 36px;
    padding: 0;
  }

  .gallery-card-open,
  .gallery-card--short .gallery-card-open,
  .gallery-card--tall .gallery-card-open {
    height: 270px;
  }

  .gallery-card--short .gallery-card-open {
    height: 205px;
  }

  .gallery-card--tall .gallery-card-open {
    height: 324px;
  }
}

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

/* AI Video Generate Flow introduction and long brand name. */
.gallery-header { gap: 16px; }
.gallery-brand { min-width: 0; }
.gallery-brand > span:last-child { max-width: 21ch; line-height: 1.15; }
.gallery-header-actions { flex: 0 0 auto; }
.studio-intro { max-width: 800px; padding: 40px 0 32px; }
.studio-eyebrow { margin: 0 0 16px; color: var(--gallery-pink); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.studio-intro h1 { margin: 0; color: #fff; font-size: clamp(34px, 5vw, 60px); line-height: 1.04; letter-spacing: -.05em; }
.studio-description { margin: 20px 0 10px; color: #f8f6f7; font-size: clamp(16px, 2vw, 20px); line-height: 1.5; }
.studio-detail { max-width: 58ch; margin: 0; color: #aaa4ad; font-size: 14px; line-height: 1.7; }
.studio-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 24px; }
.studio-actions button { gap: 16px; min-height: 46px; cursor: pointer; }
.studio-actions a { color: #d8d1da; font-size: 13px; font-weight: 600; text-decoration: none; }
.studio-actions a:hover { color: #fff; }
.studio-note { max-width: 70ch; margin: 18px 0 0; color: #aaa4ad; font-size: 11px; line-height: 1.7; }
@media (max-width: 600px) {
  .gallery-header { gap: 10px; padding: 10px 14px; }
  .gallery-header .gallery-brand { gap: 7px; font-size: 15px; }
  .gallery-header .gallery-brand > span:last-child { max-width: 16ch; }
  .gallery-header .icon-button { display: none; }
  .gallery-header .create-button { min-height: 36px; padding: 0 12px; font-size: 12px; }
  .studio-intro { padding: 28px 0; }
  .gallery-ribbon { font-size: 9px; letter-spacing: .1em; }
  .gallery-footer .gallery-brand > span:last-child { max-width: 18ch; }
  .legal-main .gallery-brand { font-size: 15px; }
}

/* Keep empty pagination and inactive upload previews hidden. */
.gallery-body [hidden] { display: none !important; }

@media (max-width: 390px) {
  .studio-actions .create-button { width: auto; padding: 0 16px; }
}
