:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-soft: #f1f1ee;
  --surface-muted: #e9e9e4;
  --text: #0d0d0d;
  --text-secondary: #5f5f5a;
  --text-muted: #8a8a84;
  --border: #deded8;
  --border-strong: #c9c9c2;
  --accent: #10a37f;
  --accent-hover: #0e8f70;
  --accent-soft: #e6f4ef;
  --danger: #d92d20;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

body.account-blocked {
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
}

body.account-blocked .page,
body.account-blocked .gallery-workspace,
body.account-blocked .composer-shell {
  user-select: none;
  -webkit-user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a[href],
button:not(:disabled),
[role="button"] {
  cursor: pointer;
}

img,
svg,
button,
.brand,
.avatar,
.menu,
.filters,
.bulk-toolbar,
.chip,
.thumb,
.thumb-action,
.bulk-check,
.composer-actions,
.icon-btn,
.select-trigger,
.select-menu,
.reference-chip,
.preview-image-wrap,
.preview-close-icon,
.preview-icon-btn,
.confirm-panel,
.toast {
  user-select: none;
  -webkit-user-select: none;
}

img {
  -webkit-user-drag: none;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(247, 247, 244, 0.98);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  font-size: 15px;
  font-weight: 620;
  white-space: nowrap;
  text-align: left;
}

.brand-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.brand-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: block;
  border-radius: 7px;
  object-fit: contain;
}

.mark {
  width: 24px;
  height: 24px;
  border: 1px solid var(--text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.mark::before,
.mark::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 1px;
  background: var(--text);
}

.mark::after {
  transform: rotate(90deg);
}

.toplink,
.quota {
  color: var(--text-secondary);
  font-size: 13px;
}

.app-topbar .quota {
  display: none;
}

.auth-shell {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.auth-main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 72px;
  align-items: center;
  padding: 72px 0;
}

.auth-intro {
  max-width: 560px;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 76px);
  line-height: 0.98;
  font-weight: 560;
  letter-spacing: 0;
}

.auth-panel h2 {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 540;
}

.sample-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 40px;
  max-width: 520px;
}

.sample {
  min-height: 164px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  background: var(--surface-muted);
}

.sample-live {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 188px;
  background: var(--surface);
}

.sample-live img {
  width: 100%;
  height: 164px;
  display: block;
  object-fit: cover;
}

.sample-live figcaption {
  min-width: 0;
  padding: 8px 10px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.25;
}

.sample.one {
  background: radial-gradient(circle at 62% 30%, #f8e7b7 0 15%, transparent 16%), linear-gradient(145deg, #d9e7df 0 34%, #aabdb3 35% 66%, #f4f1e7 67%);
}

.sample.two {
  background: radial-gradient(circle at 50% 42%, #fff 0 14%, transparent 15%), linear-gradient(160deg, #282828 0 42%, #8b9c97 43% 68%, #e8e2d5 69%);
}

.sample.three {
  background: radial-gradient(circle at 72% 28%, #e2eff0 0 17%, transparent 18%), linear-gradient(135deg, #c8d2ca 0 28%, #f8f6ed 29% 70%, #41433f 71%);
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 28px;
}

body.auth-wall-body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050505;
}

.service-paused-body {
  min-height: 100svh;
  background: #f7f7f4;
}

.service-paused-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 80px 24px;
}

.service-paused-panel {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: 0;
  text-align: left;
}

.service-paused-kicker {
  width: max-content;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
}

.service-paused-panel h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.98;
  font-weight: 560;
}

.service-paused-message {
  max-width: 460px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.55;
}

.service-paused-message > :first-child {
  margin-top: 0;
}

.service-paused-message > :last-child {
  margin-bottom: 0;
}

.service-paused-message a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.service-paused-message p,
.service-paused-message ul,
.service-paused-message ol {
  margin: 0 0 10px;
}

.service-paused-message ul,
.service-paused-message ol {
  padding-left: 20px;
}

.service-paused-return {
  width: max-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #0d0d0d;
  border-radius: var(--radius-md);
  background: #0d0d0d;
  color: #fff;
  font-size: 13px;
  font-weight: 560;
}

.auth-wall-shell {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: center;
  padding: 46px 24px;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.05) 23%, transparent 45%),
    linear-gradient(180deg, transparent 0 72%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(90deg, #020202 0%, #181818 27%, #8f8f8a 50%, #181818 73%, #020202 100%);
}

.auth-wall-shell::before,
.auth-wall-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transition: opacity 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-wall-shell::before {
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(255, 255, 255, 0.5) 0 12%, rgba(255, 255, 255, 0.16) 28%, transparent 48%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.74), transparent 29% 71%, rgba(0, 0, 0, 0.76)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.44), transparent 28% 68%, rgba(0, 0, 0, 0.58));
}

.auth-wall-shell.is-started::before {
  opacity: 1;
}

.auth-wall-shell::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 36% 64%, rgba(0, 0, 0, 0.34)),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.04), transparent 30%);
  backdrop-filter: blur(2px);
  mask-image: radial-gradient(ellipse at 50% 48%, transparent 0 24%, rgba(0, 0, 0, 0.62) 56%, #000 100%);
}

.auth-wall-gallery {
  position: absolute;
  inset: 0;
  z-index: 1;
  perspective: 1400px;
  transform-style: preserve-3d;
}

.auth-wall-tile {
  position: absolute;
  margin: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  --tile-depth-filter: opacity(1);
  --tile-shadow-strong: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.42));
  --tile-shadow-close: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.32));
  transform-style: preserve-3d;
  aspect-ratio: var(--ratio, 1 / 1);
  --tile-transform: translateZ(0);
  --scroll-x: 0px;
  --scroll-y: -96px;
  --scroll-duration: 16s;
  --scroll-delay: 0s;
  translate: 0 0;
  transform: var(--tile-transform);
  filter: var(--tile-depth-filter) var(--tile-shadow-strong) var(--tile-shadow-close);
  animation: auth-wall-scroll var(--scroll-duration) cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
  animation-delay: var(--scroll-delay);
  will-change: translate;
}

.auth-wall-shell.auth-wall-ready .auth-wall-tile {
  transition:
    transform 980ms cubic-bezier(0.19, 1, 0.22, 1),
    opacity 760ms ease;
  transition-delay: var(--scatter-delay, 0ms);
}

.auth-wall-shell.auth-wall-preparing .auth-wall-tile {
  opacity: 0;
  transform: translate3d(var(--scatter-x, 0), var(--scatter-y, 0), 0) scale(0.72) var(--tile-transform);
}

.auth-wall-shell.auth-wall-scattering .auth-wall-tile {
  animation-play-state: paused;
}

.auth-wall-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: saturate(0.72) contrast(1.04) brightness(0.86);
}

.auth-wall-tile.is-empty img {
  display: none;
}

.auth-wall-tile.color img {
  filter: saturate(0.88) contrast(1.04) brightness(0.84);
}

.auth-wall-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, transparent 0 54%, rgba(0, 0, 0, 0.38) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.3));
}

@keyframes auth-wall-scroll {
  from {
    translate: 0 0;
  }

  to {
    translate: var(--scroll-x) var(--scroll-y);
  }
}

.auth-wall-tile.left-1 {
  left: 0;
  top: 2vh;
  width: 15vw;
  min-width: 150px;
  --tile-transform: rotateY(18deg) translateZ(-40px);
  --scroll-x: 12px;
  --scroll-y: -86px;
  --scroll-duration: 17s;
  mask-image: linear-gradient(90deg, #000 0 76%, transparent 100%);
}

.auth-wall-tile.left-2 {
  left: 11vw;
  top: 0;
  width: 13vw;
  min-width: 140px;
  --tile-transform: rotateY(14deg) translateZ(26px);
  --scroll-x: -8px;
  --scroll-y: 76px;
  --scroll-duration: 16s;
  --scroll-delay: -4s;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 0 70%, transparent 100%);
}

.auth-wall-tile.left-3 {
  left: 23vw;
  top: 3vh;
  width: 12vw;
  min-width: 120px;
  --tile-transform: rotateY(10deg) translateZ(-70px);
  --scroll-x: 8px;
  --scroll-y: -64px;
  --scroll-duration: 20s;
  --scroll-delay: -8s;
  opacity: 0.72;
  --tile-depth-filter: blur(0.4px);
}

.auth-wall-tile.left-4 {
  left: 2vw;
  top: 26vh;
  width: 17vw;
  min-width: 180px;
  --tile-transform: rotateY(18deg) translateZ(0);
  --scroll-x: -12px;
  --scroll-y: 82px;
  --scroll-duration: 18s;
  --scroll-delay: -2s;
  mask-image: linear-gradient(90deg, #000 0 84%, transparent 100%);
}

.auth-wall-tile.left-5 {
  left: 17vw;
  top: 34vh;
  width: 14vw;
  min-width: 150px;
  --tile-transform: rotateY(12deg) translateZ(70px);
  --scroll-x: 10px;
  --scroll-y: -88px;
  --scroll-duration: 15s;
  --scroll-delay: -7s;
}

.auth-wall-tile.left-6 {
  left: 4vw;
  bottom: 2vh;
  width: 19vw;
  min-width: 200px;
  --tile-transform: rotateY(16deg) translateZ(48px);
  --scroll-x: 10px;
  --scroll-y: -72px;
  --scroll-duration: 18s;
  --scroll-delay: -11s;
  mask-image: linear-gradient(90deg, #000 0 78%, transparent 100%);
}

.auth-wall-tile.left-7 {
  left: 27vw;
  bottom: 2vh;
  width: 13vw;
  min-width: 140px;
  --tile-transform: rotateY(9deg) translateZ(14px);
  --scroll-x: -10px;
  --scroll-y: 74px;
  --scroll-duration: 16s;
  --scroll-delay: -5s;
  opacity: 0.86;
}

.auth-wall-tile.right-1 {
  right: 0;
  top: 2vh;
  width: 17vw;
  min-width: 180px;
  --tile-transform: rotateY(-18deg) translateZ(-26px);
  --scroll-x: -12px;
  --scroll-y: 86px;
  --scroll-duration: 17s;
  mask-image: linear-gradient(90deg, transparent 0, #000 24% 100%);
}

.auth-wall-tile.right-2 {
  right: 16vw;
  top: 0;
  width: 12vw;
  min-width: 130px;
  --tile-transform: rotateY(-12deg) translateZ(18px);
  --scroll-x: 8px;
  --scroll-y: -78px;
  --scroll-duration: 16s;
  --scroll-delay: -3s;
  opacity: 0.82;
}

.auth-wall-tile.right-3 {
  right: 7vw;
  top: 22vh;
  width: 20vw;
  min-width: 210px;
  --tile-transform: rotateY(-16deg) translateZ(80px);
  --scroll-x: -10px;
  --scroll-y: 82px;
  --scroll-duration: 16s;
  --scroll-delay: -9s;
}

.auth-wall-tile.right-4 {
  right: 27vw;
  top: 32vh;
  width: 12vw;
  min-width: 130px;
  --tile-transform: rotateY(-9deg) translateZ(-30px);
  --scroll-x: 8px;
  --scroll-y: -66px;
  --scroll-duration: 20s;
  --scroll-delay: -6s;
  opacity: 0.64;
  --tile-depth-filter: blur(0.8px);
}

.auth-wall-tile.right-5 {
  right: 21vw;
  bottom: 8vh;
  width: 14vw;
  min-width: 150px;
  --tile-transform: rotateY(-13deg) translateZ(52px);
  --scroll-x: -10px;
  --scroll-y: 88px;
  --scroll-duration: 15s;
  --scroll-delay: -12s;
}

.auth-wall-tile.right-6 {
  right: 7vw;
  bottom: 3vh;
  width: 18vw;
  min-width: 190px;
  --tile-transform: rotateY(-16deg) translateZ(26px);
  --scroll-x: -8px;
  --scroll-y: -74px;
  --scroll-duration: 18s;
  --scroll-delay: -5s;
  mask-image: linear-gradient(90deg, transparent 0, #000 18% 100%);
}

.auth-wall-haze {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 47%, rgba(255, 255, 255, 0.42) 0 13%, rgba(255, 255, 255, 0.2) 26%, transparent 44%),
    radial-gradient(ellipse at 50% 52%, rgba(255, 255, 255, 0.16), transparent 50%);
  filter: blur(14px);
  transition: opacity 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-wall-shell.is-started .auth-wall-haze {
  opacity: 1;
}

.auth-wall-brand {
  position: fixed;
  z-index: 8;
  top: 34px;
  left: 42px;
  display: flex;
  align-items: center;
  gap: 22px;
  color: rgba(255, 255, 255, 0.88);
}

.auth-wall-brand:empty {
  display: none;
}

.auth-wall-brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(0, 0, 0, 0.16);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.2);
}

.auth-wall-brand-name {
  font-size: 14px;
  font-weight: 520;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.46);
  white-space: nowrap;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 520;
  white-space: nowrap;
}

.language-switch svg {
  flex: 0 0 auto;
}

.auth-wall-language {
  position: fixed;
  z-index: 8;
  top: 34px;
  right: 42px;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.46);
}

.auth-wall-language:hover {
  background: rgba(255, 255, 255, 0.12);
}

.app-language {
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.62);
}

.app-language:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}

.auth-wall-intro {
  position: relative;
  grid-area: 1 / 1;
  z-index: 7;
  width: min(720px, calc(100vw - 56px));
  color: rgba(255, 255, 255, 0.94);
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 540ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 540ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-wall-shell.is-started .auth-wall-intro {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

.auth-wall-intro h1 {
  margin: 0;
  max-width: 720px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(62px, 6.6vw, 104px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.32),
    0 24px 82px rgba(0, 0, 0, 0.52);
}

.auth-wall-start {
  margin-top: clamp(26px, 4vh, 42px);
  min-width: 156px;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 560;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.32);
}

.auth-wall-card {
  position: relative;
  grid-area: 1 / 1;
  z-index: 7;
  width: min(100%, 430px);
  padding: 34px 38px 36px;
  border-radius: 18px;
  border: 1px solid rgba(13, 13, 13, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
  transition:
    opacity 680ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-wall-card-register {
  width: min(100%, 480px);
  padding-block: 30px 32px;
}

.auth-wall-auth-card {
  width: min(100%, 430px);
}

.auth-wall-shell.is-register .auth-wall-auth-card {
  width: min(100%, 480px);
  padding-block: 30px 32px;
}

.auth-wall-shell.is-started .auth-wall-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.auth-wall-panel {
  display: none;
}

.auth-wall-shell:not(.is-register) .auth-wall-panel-login,
.auth-wall-shell.is-register .auth-wall-panel-register {
  display: block;
}

.auth-wall-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(13, 13, 13, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(13, 13, 13, 0.62);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.auth-wall-logo {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
}

.auth-wall-card h2 {
  margin: 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.auth-wall-panel > p {
  margin: 8px 0 26px;
  text-align: center;
  color: rgba(13, 13, 13, 0.56);
  font-size: 14px;
}

.auth-wall-form .field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.auth-wall-form label {
  color: var(--text);
  font-size: 12px;
}

.auth-wall-input {
  min-width: 0;
  min-height: 44px;
  display: grid;
  align-items: center;
  border: 1px solid rgba(13, 13, 13, 0.18);
  background: rgba(255, 255, 255, 0.74);
}

.auth-wall-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  padding: 0 14px;
}

.auth-wall-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.auth-wall-code-btn {
  min-width: max-content;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(13, 13, 13, 0.18);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.auth-wall-code-btn:disabled {
  color: var(--text-muted);
  background: rgba(241, 241, 238, 0.74);
  cursor: not-allowed;
}

.auth-wall-captcha {
  min-width: 0;
  overflow: hidden;
}

.auth-wall-captcha .cf-turnstile {
  min-height: 65px;
}

.auth-wall-submit,
.auth-wall-outline {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--text);
  background: var(--text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-wall-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
  color: rgba(13, 13, 13, 0.56);
  font-size: 12px;
}

.auth-wall-split::before,
.auth-wall-split::after {
  content: "";
  height: 1px;
  background: rgba(13, 13, 13, 0.12);
}

.auth-wall-outline {
  background: rgba(255, 255, 255, 0.48);
  color: var(--text);
}

.login-editorial-shell {
  grid-template-rows: auto 1fr;
}

.login-editorial-main {
  min-height: calc(100svh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
}

.login-gallery-side {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: clamp(28px, 4vw, 54px);
  background:
    linear-gradient(90deg, rgba(247, 247, 244, 0.34), rgba(247, 247, 244, 0.86) 88%),
    #e8e5dd;
  isolation: isolate;
}

.login-gallery-side::before,
.login-gallery-side::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-gallery-side::before {
  z-index: -3;
  background:
    radial-gradient(circle at 72% 20%, rgba(255, 236, 188, 0.85) 0 8%, transparent 9%),
    radial-gradient(circle at 38% 48%, rgba(255, 255, 255, 0.62) 0 12%, transparent 13%),
    linear-gradient(116deg, rgba(22, 23, 21, 0.86) 0 18%, transparent 19%),
    linear-gradient(18deg, rgba(13, 13, 13, 0.82) 0 20%, transparent 21%),
    linear-gradient(142deg, #756f63 0 28%, #a9b7af 29% 48%, #e9e3d6 49% 74%, #2f312e 75%);
}

.login-gallery-side::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(247, 247, 244, 0.04), rgba(247, 247, 244, 0.68)),
    linear-gradient(90deg, rgba(247, 247, 244, 0.52) 0%, rgba(247, 247, 244, 0.42) 38%, rgba(247, 247, 244, 0.9) 94%);
}

.login-hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-headline {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
}

.login-headline::before {
  content: "";
  position: absolute;
  inset: -22px -34px -24px -24px;
  z-index: -1;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 32% 52%, rgba(247, 247, 244, 0.72), rgba(247, 247, 244, 0.36) 52%, transparent 76%);
  filter: blur(10px);
}

.login-headline h1 {
  max-width: 620px;
  font-size: clamp(42px, 6.5vw, 86px);
  line-height: 0.94;
  text-shadow: 0 1px 26px rgba(247, 247, 244, 0.42);
}

.login-hero-credit {
  position: absolute;
  left: clamp(28px, 4vw, 54px);
  bottom: clamp(28px, 5vw, 64px);
  z-index: 1;
  color: rgba(13, 13, 13, 0.56);
  font-size: 12px;
  line-height: 1.2;
}

.login-recent-board {
  position: absolute;
  right: clamp(24px, 4vw, 58px);
  bottom: clamp(28px, 5vw, 64px);
  width: min(45vw, 430px);
  min-width: 320px;
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  grid-template-rows: 168px 168px;
  gap: 12px;
  align-items: stretch;
}

.login-frame {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(13, 13, 13, 0.1);
  border-radius: 14px;
  background: var(--surface-soft);
  box-shadow: 0 20px 60px rgba(13, 13, 13, 0.13);
  isolation: isolate;
}

.login-frame::before,
.login-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.login-frame::after {
  z-index: 1;
  background: linear-gradient(180deg, transparent 54%, rgba(0, 0, 0, 0.48));
  pointer-events: none;
}

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

.login-frame.main-frame {
  grid-row: 1 / span 2;
  min-height: 348px;
}

.login-frame.fallback-one::before {
  background:
    radial-gradient(circle at 62% 28%, #f7dda1 0 9%, transparent 10%),
    linear-gradient(18deg, rgba(9, 9, 9, 0.86) 0 22%, transparent 23%),
    radial-gradient(ellipse at 55% 46%, #d8d5c9 0 14%, transparent 15%),
    linear-gradient(145deg, #746f64 0 26%, #b7c1ba 27% 50%, #eee9dd 51% 72%, #2f302d 73%);
}

.login-frame.fallback-two::before {
  background:
    radial-gradient(circle at 35% 36%, rgba(255, 255, 255, 0.9) 0 14%, transparent 15%),
    radial-gradient(circle at 72% 68%, rgba(13, 13, 13, 0.74) 0 10%, transparent 11%),
    linear-gradient(150deg, #e9e3d5 0 32%, #4d5a56 33% 54%, #bdc8bf 55% 74%, #20211f 75%);
}

.login-frame.fallback-three::before {
  background:
    radial-gradient(circle at 76% 25%, #e4f1f2 0 16%, transparent 17%),
    radial-gradient(circle at 46% 72%, rgba(16, 163, 127, 0.25) 0 13%, transparent 14%),
    linear-gradient(135deg, #c8d2ca 0 30%, #f8f6ed 31% 68%, #41433f 69%);
}

.login-frame figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.2;
}

.login-frame figcaption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-frame figcaption small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  white-space: nowrap;
}

.login-auth-side {
  min-width: 0;
  display: grid;
  align-items: center;
  padding: clamp(28px, 5vw, 58px);
  border-left: 1px solid rgba(13, 13, 13, 0.08);
  background: var(--bg);
}

.login-auth-panel {
  width: 100%;
  max-width: 356px;
  justify-self: center;
  padding: 6px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  color: var(--text-secondary);
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input {
  height: 44px;
  padding: 0 12px;
}

input:focus,
textarea:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.btn-primary {
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid #0d0d0d;
  background: #0d0d0d;
  color: #fff;
  cursor: pointer;
}

.btn-primary:hover {
  background: #262626;
}

.btn-secondary {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.btn-secondary[disabled] {
  color: var(--text-muted);
  cursor: wait;
}

.full {
  width: 100%;
}

.email-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.code-send-btn {
  padding: 0 12px;
  white-space: nowrap;
}

.field-status {
  min-height: 17px;
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.field-status.error {
  color: var(--danger);
}

.field-status.success {
  color: #047857;
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--text-secondary);
  font-size: 13px;
}

.link {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px 24px;
  color: var(--text-muted);
  font-size: 12px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message,
.notice,
.form-error {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 13px;
}

.message.error,
.form-error {
  background: #fff0ed;
  color: var(--danger);
}

.message.success {
  background: #ecfdf5;
  color: #047857;
}

.setup-warning {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #e4d7ae;
  border-radius: var(--radius-lg);
  background: #fffaf0;
  color: #6d5618;
}

.setup-warning-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f8e9b7;
}

.setup-warning-icon svg {
  width: 17px;
  height: 17px;
}

.setup-warning-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  font-size: 13px;
  line-height: 1.45;
}

.setup-warning-copy strong {
  color: #4d3b0f;
  font-size: 13px;
  font-weight: 650;
}

.setup-warning-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid #d6c58e;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: #4d3b0f;
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
}

.setup-warning-action:hover {
  border-color: #bca968;
  background: #fffcf5;
}

.setup-warning-action:focus-visible {
  outline: 3px solid rgba(16, 163, 127, 0.24);
  outline-offset: 2px;
}

.page {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 280px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.immersive-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.immersive-toggle:hover,
.immersive-toggle:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
}

.immersive-toggle svg {
  width: 17px;
  height: 17px;
}

.immersive-toggle .immersive-exit-icon {
  display: none;
}

body.immersive-mode .immersive-toggle {
  border-color: #0d0d0d;
  background: #0d0d0d;
  color: #fff;
}

body.immersive-mode .immersive-toggle .immersive-enter-icon {
  display: none;
}

body.immersive-mode .immersive-toggle .immersive-exit-icon {
  display: block;
}

.avatar-wrap {
  position: relative;
}

.avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: #0d0d0d;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.menu {
  position: absolute;
  top: 44px;
  right: 0;
  width: 188px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  display: none;
}

.menu.open {
  display: block;
}

.menu-user {
  display: grid;
  gap: 3px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.menu-user-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.menu-user strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 650;
}

.menu-user em {
  flex: 0 1 auto;
  max-width: 84px;
  min-width: 0;
  align-self: baseline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 7px 4px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 11px;
  line-height: 1.1;
  font-style: normal;
  font-weight: 620;
}

.menu-user small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.25;
}

.menu a,
.menu button {
  width: 100%;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

.menu a:hover,
.menu button:hover {
  background: var(--surface-soft);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
}

.meta-row h1 {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 540;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.gallery-workspace {
  position: relative;
  min-height: 360px;
}

.blocked-gallery-overlay {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(247, 247, 244, 0.62), rgba(247, 247, 244, 0.78)),
    rgba(247, 247, 244, 0.68);
  backdrop-filter: blur(5px) saturate(0.92);
  pointer-events: auto;
}

body.account-blocked .composer-shell {
  pointer-events: none;
}

.blocked-status-card {
  display: grid;
  justify-items: center;
  gap: 9px;
  width: min(340px, 100%);
  padding: 22px 24px 24px;
  border: 1px solid rgba(13, 13, 13, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  text-align: center;
  box-shadow:
    0 24px 64px rgba(13, 13, 13, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.blocked-status-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(13, 13, 13, 0.1);
  border-radius: 999px;
  background: #f7f7f4;
  color: var(--text);
}

.blocked-status-icon svg {
  width: 17px;
  height: 17px;
}

.blocked-gallery-overlay strong {
  font-size: 17px;
  font-weight: 560;
  line-height: 1.2;
}

.blocked-status-detail {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.clear-gallery {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #ffd0c8;
  border-radius: var(--radius-md);
  background: #fff7f5;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.clear-gallery:hover {
  border-color: #f5a79b;
  background: #fff0ed;
  color: #b42318;
}

.clear-gallery.neutral {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}

.clear-gallery.neutral:hover {
  border-color: var(--border-strong);
  background: #f9f9f6;
  color: var(--text);
}

.clear-gallery[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
}

.clear-gallery[disabled]:hover {
  border-color: #ffd0c8;
  background: #fff7f5;
  color: var(--danger);
}

.clear-gallery.neutral[disabled]:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}

.clear-gallery.danger {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff0ed;
  color: #b42318;
}

.clear-gallery.danger:hover {
  border-color: rgba(180, 35, 24, 0.36);
  background: #ffe9e5;
  color: #971b12;
}

.clear-gallery.danger[disabled]:hover {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff0ed;
  color: #b42318;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin: -8px 0 20px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(13, 13, 13, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  font-size: 13px;
  box-shadow: var(--shadow-soft);
}

.bulk-toolbar[hidden] {
  display: none;
}

.bulk-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chip {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
}

.chip.active {
  background: #0d0d0d;
  color: #fff;
  border-color: #0d0d0d;
}

.gallery {
  column-count: 4;
  column-gap: 14px;
}

.gallery[data-gallery] {
  column-count: auto;
  --gallery-columns: 4;
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
  align-items: start;
  gap: 16px 14px;
  position: relative;
  overflow-anchor: none;
}

.gallery.is-masonry {
  display: block;
}

.gallery.is-masonry > .item {
  position: absolute;
  top: 0;
  left: 0;
}

.gallery > .empty {
  grid-column: 1 / -1;
}

.gallery[data-gallery] > .item {
  margin: 0;
}

.gallery .thumb > .gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 300ms ease, filter 140ms ease;
}

.gallery .thumb:has(> .gallery-image) {
  border: 0;
}

.gallery .gallery-image[data-image-state="loading"],
.gallery .gallery-image[data-image-state="error"] {
  opacity: 0;
}

.image-retry {
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 0;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.gallery-sentinel {
  width: 100%;
  min-height: 64px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  overflow-anchor: none;
}

.gallery-sentinel[hidden],
.gallery-sentinel button[hidden] {
  display: none;
}

.gallery-load-dots {
  display: none;
  gap: 4px;
}

.gallery-sentinel.is-loading .gallery-load-dots {
  display: flex;
}

.gallery-load-dots i {
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  animation: gallery-pulse 1s ease-in-out infinite alternate;
}

.gallery-load-dots i:nth-child(2) { animation-delay: 150ms; }
.gallery-load-dots i:nth-child(3) { animation-delay: 300ms; }

@keyframes gallery-pulse {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery .thumb > .gallery-image { transition: none; }
  .gallery-load-dots i,
  .gallery .thumb.loading::after { animation: none; }
}

.item {
  display: inline-block;
  width: 100%;
  min-width: 0;
  margin: 0 0 16px;
  break-inside: avoid;
  vertical-align: top;
}

.item.selectable .thumb {
  cursor: pointer;
}

.item.selectable .thumb img {
  transition: filter 140ms ease, transform 140ms ease;
}

.item.selectable:hover .thumb img,
.item.selectable:focus-within .thumb img {
  filter: brightness(0.96);
}

.item.selected .thumb {
  border-color: rgba(13, 13, 13, 0.56);
  box-shadow: 0 0 0 2px rgba(13, 13, 13, 0.56), 0 0 0 5px rgba(13, 13, 13, 0.08);
}

.thumb {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  background: var(--surface-muted);
  position: relative;
}

.bulk-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(13, 13, 13, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(13, 13, 13, 0.12);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.bulk-check::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg);
}

.bulk-check:hover,
.bulk-check:focus-visible {
  border-color: rgba(13, 13, 13, 0.48);
  transform: translateY(-1px);
}

.bulk-check.selected {
  border-color: #0d0d0d;
  background: #0d0d0d;
}

.bulk-check.selected::after {
  opacity: 1;
}

.thumb[role="button"] {
  cursor: pointer;
}

.thumb[role="button"]:focus-visible {
  outline: 3px solid rgba(16, 163, 127, 0.18);
  outline-offset: 3px;
}

.thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.thumb-action {
  position: absolute;
  z-index: 4;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.thumb-download {
  top: 10px;
  right: 10px;
}

.thumb-privacy {
  top: 10px;
  left: 10px;
}

.thumb-privacy.is-hidden {
  opacity: 1;
  transform: translateY(0);
}

.thumb-edit {
  right: 10px;
  bottom: 10px;
}

.thumb-cancel {
  top: 10px;
  right: 10px;
  font-size: 22px;
  line-height: 1;
}

.thumb:hover .thumb-action,
.thumb:focus-within .thumb-action {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.thumb-action:hover {
  background: #ffffff;
}

.thumb-action svg {
  width: 16px;
  height: 16px;
}

.thumb.placeholder {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #d9e7df 0 34%, #aabdb3 35% 66%, #f4f1e7 67%);
}

.thumb.loading {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.92), transparent 30%),
    radial-gradient(circle at 78% 74%, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(135deg, rgba(232, 235, 228, 0.96), rgba(194, 206, 198, 0.78) 48%, rgba(246, 243, 235, 0.94));
  isolation: isolate;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 18px 42px rgba(255, 255, 255, 0.22),
    inset 0 -24px 46px rgba(101, 118, 109, 0.12);
}

.thumb.loading.has-reference {
  background: #e9e9e4;
}

.thumb.loading .loading-reference {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  filter: blur(4px) saturate(0.96) brightness(0.98);
  transform: scale(1.03);
  pointer-events: none;
  user-select: none;
}

.thumb.loading.has-reference::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(241, 241, 238, 0.16) 52%, rgba(255, 255, 255, 0.28));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 18px 42px rgba(255, 255, 255, 0.12);
}

.thumb.loading::after {
  content: "";
  position: absolute;
  inset: -54%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.08) 41%,
    rgba(255, 255, 255, 0.46) 50%,
    rgba(255, 255, 255, 0.08) 59%,
    transparent 70%
  );
  filter: blur(1.4px);
  transform: translateX(-54%) rotate(10deg);
  animation: light-wave 1.85s ease-in-out infinite;
  will-change: transform, opacity;
}

.caption {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 2px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

body.immersive-mode .meta-row,
body.immersive-mode .bulk-toolbar,
body.immersive-mode .caption,
body.immersive-mode .composer-shell {
  display: none !important;
}

body.immersive-mode .page {
  padding-bottom: 56px;
}

body.immersive-mode .gallery-workspace {
  padding-top: 6px;
}

body.immersive-mode .gallery {
  gap: 8px;
}

body.immersive-mode .item {
  margin-bottom: 8px;
}

body.immersive-mode .thumb-action:not(.thumb-download) {
  display: none;
}

body.immersive-mode .thumb-download {
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
}

.caption strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 520;
}

.expires {
  color: var(--text-muted);
  white-space: nowrap;
}

.permanent-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.permanent-meta svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: var(--text);
}

.status {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: #0f766e;
  font-size: 12px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot 1.2s ease-in-out infinite;
}

.thumb:not(.loading) .dot {
  display: none;
}

@keyframes light-wave {
  0% {
    transform: translateX(-54%) rotate(10deg);
    opacity: 0;
  }
  18% {
    opacity: 0.72;
  }
  64% {
    opacity: 0.64;
  }
  100% {
    transform: translateX(54%) rotate(10deg);
    opacity: 0;
  }
}

@keyframes dot {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.86);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.empty {
  color: var(--text-muted);
  font-size: 14px;
}

.composer-shell {
  --composer-bottom: 22px;
  --composer-width: min(760px, calc(100% - 48px));
  position: fixed;
  left: 50%;
  bottom: var(--composer-bottom);
  z-index: 30;
  width: var(--composer-width);
  transform: translateX(-50%);
}

.mobile-quota-popover {
  position: absolute;
  left: 10px;
  bottom: calc(100% + 10px);
  z-index: 2;
  display: block;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-secondary);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.composer-status-popover {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px 5px 5px;
  color: var(--text-secondary);
}

.composer-group-chip {
  max-width: 128px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 9px 6px;
  border-radius: 8px;
  background: #0d0d0d;
  color: #fff;
  font-weight: 620;
}

.composer-shell.prompt-focused .mobile-quota-popover {
  opacity: 1;
  transform: translateY(0);
}

body.preview-open .composer-shell {
  opacity: 0;
  pointer-events: none;
}

.composer {
  min-height: 110px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  padding: 16px 20px 12px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.15), var(--shadow-soft);
}

.reference-chip {
  width: max-content;
  max-width: 100%;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.reference-chip[hidden] {
  display: none;
}

.reference-chip img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.reference-chip span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 13px;
}

.reference-chip button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.reference-chip button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.prompt {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  max-height: 148px;
  resize: none;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1.45;
  outline: none;
  overflow-y: hidden;
}

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

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.82);
}

.preview-panel {
  position: relative;
  width: calc(100vw - 48px);
  height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.preview-stage {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  overscroll-behavior: contain;
}

.preview-title {
  width: min(100%, 1120px);
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  font-weight: 560;
  line-height: 1.35;
  text-align: left;
}

.preview-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  max-width: min(100%, 1120px);
  max-height: calc(100vh - 172px);
  max-height: calc(100dvh - 172px);
}

.preview-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: inherit;
  display: block;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.preview-close-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.preview-close-icon:hover {
  background: #fff;
}

.preview-actions {
  width: min(1120px, 100%);
  min-height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 16px;
  color: #fff;
}

.preview-actions p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.preview-actions div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.preview-btn.primary {
  border-color: #fff;
  background: #fff;
  color: #0d0d0d;
}

.preview-icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.preview-icon-btn.primary {
  border-color: #fff;
  background: #fff;
  color: #0d0d0d;
}

.preview-icon-btn svg {
  width: 17px;
  height: 17px;
}

.preview-btn.danger {
  border-color: #0d0d0d;
  background: #0d0d0d;
  color: #fff;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.42);
}

.confirm-panel {
  position: relative;
  width: min(380px, 100%);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.confirm-panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 540;
}

.confirm-panel p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

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

.confirm-actions .preview-btn {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.confirm-actions .preview-btn.danger {
  color: #fff;
  border-color: #0d0d0d;
  background: #0d0d0d;
}

.welcome-modal[hidden] {
  display: none;
}

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 20px;
}

.welcome-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.44);
}

.welcome-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(680px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.welcome-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 560;
}

.welcome-content {
  min-height: 0;
  overflow: auto;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.58;
}

.welcome-content :first-child {
  margin-top: 0;
}

.welcome-content :last-child {
  margin-bottom: 0;
}

.welcome-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.welcome-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: calc(var(--composer-bottom, 22px) + 184px);
  z-index: 70;
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 36px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  line-height: 1.4;
  pointer-events: auto;
}

.toast.error {
  border-color: #ffd0c8;
  background: #fff7f5;
  color: var(--danger);
}

.toast.success {
  border-color: #cdeee3;
  background: #f2fbf8;
  color: #047857;
}

.prompt:focus {
  box-shadow: none;
}

.prompt::placeholder {
  color: #6f6f68;
}

.composer-actions,
.left-tools,
.right-tools {
  display: flex;
  align-items: center;
}

.composer-actions {
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.left-tools,
.right-tools {
  gap: 8px;
  min-width: 0;
}

.icon-btn,
.generate-btn {
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #1f2933;
  font-size: 24px;
}

.icon-btn:hover {
  background: var(--surface-soft);
}

.add-menu-wrap {
  position: relative;
}

.add-menu-wrap.open .add-menu-trigger {
  background: var(--surface-soft);
}

.add-menu {
  position: absolute;
  left: 0;
  bottom: 48px;
  z-index: 35;
  width: min(214px, calc(100vw - 34px));
  box-sizing: border-box;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
  display: none;
}

.add-menu-wrap.open .add-menu {
  display: grid;
  gap: 1px;
}

.menu-action {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 520;
  text-align: left;
  cursor: pointer;
}

.menu-action:hover,
.menu-action:focus-visible {
  background: var(--surface-soft);
  border-color: var(--border);
  outline: none;
}

.menu-action:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.menu-action svg {
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  flex: 0 0 16px;
  display: block;
}

.menu-toggle {
  justify-content: space-between;
}

.menu-toggle .setting-label {
  min-width: 0;
}

.menu-switch {
  width: 28px;
  height: 16px;
  flex: 0 0 28px;
  padding: 2px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #d8d8d4;
  transition: background 140ms ease;
}

.menu-switch > span {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 140ms ease;
}

.menu-toggle[aria-checked="true"] .menu-switch {
  background: var(--text);
}

.menu-toggle[aria-checked="true"] .menu-switch > span {
  transform: translateX(12px);
}

.menu-select {
  width: 100%;
  height: auto;
  position: relative;
}

.menu-select-trigger {
  width: 100%;
  height: 34px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 28px 0 9px;
  border-color: transparent;
  overflow: hidden;
  font-size: 12px;
}

.menu-select-trigger > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-select-trigger > [data-select-label] {
  flex: 0 1 auto;
  max-width: 78px;
  color: var(--text-secondary);
  font-size: 12px;
}

.setting-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
}

.select-wrap {
  position: relative;
  height: 38px;
}

.select-trigger {
  height: 38px;
  min-width: 104px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 0 30px 0 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 520;
  text-align: left;
}

.select-trigger.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
}

.select-wrap.menu-select {
  width: 100%;
  height: auto;
}

.select-wrap.menu-select .menu-select-trigger {
  width: 100%;
  height: 34px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 28px 0 9px;
  border-color: transparent;
  overflow: hidden;
}

.select-wrap.menu-select::after {
  top: 17px;
  transform: translateY(-50%) rotate(-45deg);
}

.select-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--text-secondary);
}

.model-icon {
  border: 1.6px solid currentColor;
  border-radius: 999px;
}

.model-icon::before,
.model-icon::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: currentColor;
}

.model-icon::before {
  left: 3px;
  top: 3px;
  width: 3px;
  height: 3px;
}

.model-icon::after {
  right: 3px;
  bottom: 3px;
  width: 3px;
  height: 3px;
}

.size-icon {
  border: 1.6px solid currentColor;
  border-radius: 4px;
}

.size-icon::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 6px;
  height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
}

.quality-icon::before,
.quality-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.quality-icon::before {
  inset: 1px;
  clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%);
}

.quality-icon::after {
  right: 0;
  top: 1px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  opacity: 0.75;
}

.format-icon {
  border: 1.6px solid currentColor;
  border-radius: 3px;
}

.format-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 3px;
  height: 1.6px;
  background: currentColor;
  box-shadow: 0 -3px 0 currentColor;
}

.select-trigger:hover,
.select-trigger:focus {
  border-color: var(--border);
  background: var(--surface-soft);
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--text);
  border-bottom: 1.6px solid var(--text);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.select-menu {
  position: absolute;
  right: 0;
  bottom: 46px;
  min-width: 142px;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
  display: none;
}

.menu-select .select-menu {
  left: calc(100% + 8px);
  right: auto;
  bottom: auto;
  top: 0;
  width: min(172px, calc(100vw - 34px));
  max-height: min(268px, calc(100dvh - 24px));
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(13, 13, 13, 0.32) transparent;
  transform: translateY(var(--submenu-shift-y, 0px));
}

.menu-select .select-menu::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.menu-select .select-menu::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.menu-select .select-menu::-webkit-scrollbar-thumb {
  min-height: 26px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: rgba(13, 13, 13, 0.24);
}

.menu-select .select-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(13, 13, 13, 0.38);
}

.menu-select .select-menu::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.menu-select[data-name="size"] .select-menu {
  width: min(190px, calc(100vw - 34px));
}

.menu-select.open-left .select-menu {
  left: auto;
  right: calc(100% + 8px);
}

.select-wrap.open .select-menu {
  display: block;
}

.select-option {
  width: 100%;
  height: 30px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.select-option:hover {
  background: var(--surface-soft);
}

.select-option[aria-selected="true"]::after {
  content: "";
  width: 6px;
  height: 10px;
  border-right: 1.6px solid var(--accent);
  border-bottom: 1.6px solid var(--accent);
  transform: rotate(45deg);
}

.custom-size-panel {
  margin-top: 4px;
  padding: 8px 7px 7px;
  border-top: 1px solid var(--border);
}

.custom-size-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 5px;
}

.custom-size-field {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 540;
}

.custom-size-field input {
  width: 100%;
  min-width: 0;
  height: 28px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 7px;
  font: inherit;
  font-size: 11.5px;
  outline: none;
}

.custom-size-field input:focus {
  border-color: var(--text-secondary);
}

.custom-size-panel.is-invalid .custom-size-field input {
  border-color: rgba(185, 28, 28, 0.55);
}

.custom-size-panel.is-invalid small {
  color: #b91c1c;
}

.custom-size-separator {
  align-self: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 28px;
}

.custom-size-panel small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.25;
}

.generate-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--text);
  background: var(--text);
  color: #fff;
  font-size: 18px;
  position: relative;
}

.generate-btn:hover:not([disabled]) {
  background: #262626;
  border-color: #262626;
}

.generate-btn[disabled] {
  border-color: var(--surface-muted);
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 1;
}

.generate-btn.is-loading {
  border-color: var(--text);
  background: var(--text);
  color: transparent;
  cursor: wait;
}

.generate-btn.is-loading > span {
  opacity: 0;
}

.generate-btn.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #fff;
  border-radius: 50%;
  animation: generate-spin 0.72s linear infinite;
}

@keyframes generate-spin {
  to {
    transform: rotate(360deg);
  }
}

.settings-page {
  width: min(100% - 48px, 1040px);
  margin: 0 auto;
  padding: 34px 0 54px;
}

.settings-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.settings-heading h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 620;
}

.settings-heading p {
  margin: 0;
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.user-settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.settings-nav a {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 540;
}

.settings-nav a.is-active {
  background: var(--surface-soft);
  color: var(--text);
}

.settings-nav a span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.28;
  flex: 0 0 auto;
}

.settings-nav a.is-active span {
  opacity: 0.72;
}

.settings-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.settings-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: visible;
}

.settings-section-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfbf8;
}

.settings-section-head.subhead {
  border-top: 1px solid var(--border);
}

.settings-section-head h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 650;
}

.settings-section-head span {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.settings-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.settings-badge.ok {
  background: var(--accent-soft);
  color: #087156;
}

.settings-rows {
  display: grid;
}

.settings-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 20px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-row strong {
  font-size: 14px;
  font-weight: 620;
  line-height: 1.25;
}

.settings-row small {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.settings-control {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-size: 13px;
}

.settings-control:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.settings-select {
  position: relative;
  width: 100%;
}

.settings-select-trigger {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 520;
  text-align: left;
  cursor: pointer;
}

.settings-select-trigger:focus-visible {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.settings-select-trigger span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-select-trigger span:last-child {
  color: var(--text-secondary);
  font-size: 14px;
}

.settings-select-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: none;
  max-height: 238px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.12);
}

.settings-select.open .settings-select-menu {
  display: block;
}

.settings-select-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.settings-select-option:hover,
.settings-select-option[aria-selected="true"] {
  background: var(--surface-soft);
}

.settings-select-option span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-select-option span:last-child {
  color: var(--accent);
  opacity: 0;
}

.settings-select-option[aria-selected="true"] span:last-child {
  opacity: 1;
}

.settings-checkbox {
  justify-self: end;
  width: 20px;
  height: 20px;
  accent-color: var(--text);
}

.settings-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfbf8;
}

.settings-metrics div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.settings-metrics span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.settings-metrics strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 650;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fbfbf8;
}

.settings-actions.inline {
  border-top: 0;
}

.settings-captcha {
  padding: 0 16px 14px;
}

.settings-actions .settings-captcha {
  padding: 0;
  margin-right: auto;
}

.settings-captcha .cf-turnstile {
  min-height: 65px;
}

.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.btn[disabled] {
  opacity: 0.48;
  cursor: not-allowed;
}

.secondary-btn {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn.danger,
.danger {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff0ed;
  color: #b42318;
}

.admin-library-page {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.admin-library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
}

.admin-library-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 620;
}

.admin-library-head p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.admin-library-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-library-metrics span {
  min-width: 112px;
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.2;
}

.admin-library-metrics strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  font-weight: 650;
}

.admin-library-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(140px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.admin-library-filters label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.admin-library-filters label > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 620;
}

.admin-library-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.admin-library-bulkbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  box-shadow: var(--shadow-soft);
}

.admin-library-bulkbar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-library-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.admin-library-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.admin-library-table th,
.admin-library-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.admin-library-table th {
  background: #fbfbf8;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 680;
  text-transform: uppercase;
}

.admin-library-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-library-table tbody tr:hover {
  background: #fbfbf8;
}

.admin-library-check-col {
  width: 38px;
  text-align: center;
}

.admin-library-check-col input {
  width: 16px;
  height: 16px;
  accent-color: var(--text);
}

.admin-library-thumb {
  width: 76px;
  aspect-ratio: var(--ratio, 1 / 1);
  max-height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.admin-library-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.admin-library-thumb span,
.admin-library-empty {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.admin-library-empty {
  padding: 36px 16px;
}

.admin-library-record,
.admin-library-user,
.admin-library-wall-state,
.admin-library-date {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-library-record {
  max-width: 420px;
}

.admin-library-record strong,
.admin-library-user strong,
.admin-library-date strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 650;
}

.admin-library-record small,
.admin-library-user small,
.admin-library-date small,
.admin-library-wall-state small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.admin-library-record span {
  color: var(--text-muted);
  font-size: 11px;
}

.admin-library-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  font-weight: 650;
  white-space: nowrap;
}

.admin-library-badge.ok {
  background: var(--accent-soft);
  color: #087156;
}

.admin-library-badge.warn {
  background: #fff7e6;
  color: #8a5b0a;
}

.admin-library-badge.muted {
  color: var(--text-muted);
}

.admin-library-badge.status-failed,
.admin-library-badge.status-canceled,
.admin-library-badge.status-expired {
  background: #fff0ed;
  color: #b42318;
}

.admin-library-badge.status-running,
.admin-library-badge.status-queued {
  background: var(--accent-soft);
  color: #087156;
}

.admin-library-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-library-actions form {
  margin: 0;
}

.admin-library-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.admin-library-icon:hover,
.admin-library-icon:focus-visible {
  border-color: var(--border-strong);
  background: #fbfbf8;
  color: var(--text);
}

.admin-library-icon svg {
  width: 15px;
  height: 15px;
}

.admin-library-icon.star.is-selected {
  border-color: rgba(16, 163, 127, 0.32);
  background: var(--accent-soft);
  color: #087156;
}

.admin-library-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 18px;
}

.admin-library-pagination span {
  color: var(--text-secondary);
  font-size: 13px;
}

.admin-library-load-state {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 13px;
}

.admin-library-load-state[aria-busy="true"] {
  color: var(--text-muted);
}

.auth-wall-picker-page {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.auth-wall-picker-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
}

.auth-wall-picker-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 620;
}

.auth-wall-picker-head p {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.auth-wall-picker-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.auth-wall-picker-filters label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.auth-wall-picker-filters label > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 620;
}

.auth-wall-picker-grid {
  padding-top: 2px;
}

.auth-wall-picker-item.is-featured .thumb {
  border-color: rgba(16, 163, 127, 0.5);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.auth-wall-picker-thumb form {
  margin: 0;
}

.auth-wall-star {
  top: 10px;
  right: 10px;
}

.auth-wall-star.is-selected {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  border-color: rgba(16, 163, 127, 0.32);
  background: rgba(230, 244, 239, 0.96);
  color: #087156;
}

.auth-wall-star:hover {
  border-color: rgba(16, 163, 127, 0.38);
  background: #ffffff;
  color: #087156;
}

@media (max-width: 860px) {
  .admin-library-page {
    width: min(100% - 24px, 720px);
    padding-top: 22px;
  }

  .admin-library-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-library-metrics {
    justify-content: stretch;
  }

  .admin-library-metrics span {
    flex: 1 1 120px;
  }

  .admin-library-filters {
    grid-template-columns: 1fr;
  }

  .admin-library-filter-actions {
    justify-content: stretch;
  }

  .admin-library-filter-actions .btn {
    flex: 1;
  }

  .admin-library-bulkbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-library-bulkbar > div {
    justify-content: stretch;
  }

  .admin-library-bulkbar .clear-gallery {
    flex: 1;
    justify-content: center;
  }

  .auth-wall-picker-page {
    width: min(100% - 24px, 720px);
    padding-top: 22px;
  }

  .auth-wall-picker-head {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-wall-picker-filters {
    grid-template-columns: 1fr;
  }
}

.settings-errors,
.settings-row .errorlist {
  margin: 0;
  padding: 10px 16px;
  color: #b42318;
  font-size: 12px;
  list-style: none;
}

.settings-row .errorlist {
  grid-column: 1 / -1;
  padding: 0;
}

.settings-actions .settings-errors {
  flex: 1 1 100%;
  padding: 0;
}

@media (max-width: 980px) {
  .login-editorial-main {
    grid-template-columns: 1fr;
  }

  .login-gallery-side {
    min-height: 620px;
  }

  .login-recent-board {
    width: min(520px, calc(100% - 48px));
    right: 24px;
  }

  .login-auth-side {
    border-left: 0;
    border-top: 1px solid rgba(13, 13, 13, 0.08);
    padding: 42px 24px 56px;
  }

  .login-auth-panel {
    max-width: 420px;
  }

  .auth-main {
    grid-template-columns: 1fr;
    gap: 36px;
    width: min(520px, calc(100% - 32px));
    padding: 44px 0;
  }

  .gallery {
    column-count: 3;
  }

  .gallery[data-gallery] {
    --gallery-columns: 3;
  }
}

@media (max-width: 700px) {
  .topbar {
    gap: 10px;
    padding: 0 16px;
  }

  .brand {
    flex: 1 1 auto;
  }

  .brand-title {
    max-width: 42vw;
  }

  .top-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  .app-language {
    min-height: 32px;
    padding: 0 8px;
  }

  .app-language svg {
    width: 16px;
    height: 16px;
  }

  .login-editorial-main {
    min-height: auto;
  }

  .login-gallery-side {
    min-height: 330px;
    padding: 28px 18px 22px;
    align-items: start;
  }

  .login-headline {
    padding-top: 34px;
  }

  .login-headline h1 {
    max-width: 340px;
    font-size: clamp(38px, 13vw, 58px);
    line-height: 0.98;
  }

  .login-recent-board {
    display: none;
  }

  .login-hero-credit {
    left: 18px;
    bottom: 18px;
    color: rgba(13, 13, 13, 0.64);
  }

  .login-auth-side {
    padding-top: 28px;
    padding-bottom: 42px;
  }

  .page {
    width: min(100% - 28px, 520px);
    padding-top: 20px;
    padding-bottom: 230px;
  }

  .setup-warning {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .setup-warning-action {
    grid-column: 2;
    justify-self: start;
  }

  .settings-page {
    width: min(100% - 28px, 640px);
    padding-top: 24px;
  }

  .user-settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .settings-nav a {
    flex: 0 0 auto;
  }

  .settings-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-checkbox {
    justify-self: start;
  }

  .settings-metrics {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    flex-direction: column;
  }

  .settings-actions .btn {
    width: 100%;
  }

  .gallery {
    column-count: 2;
    column-gap: 12px;
  }

  .gallery[data-gallery] {
    --gallery-columns: 2;
    gap: 14px 12px;
  }

  .item {
    margin-bottom: 14px;
  }

  .meta-row h1 {
    font-size: 24px;
  }

  .bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
    margin-top: -4px;
  }

  .bulk-toolbar > div {
    justify-content: stretch;
  }

  .bulk-toolbar .clear-gallery {
    flex: 1 1 auto;
    justify-content: center;
  }

  .composer-shell {
    --composer-bottom: 10px;
    --composer-width: calc(100% - 16px);
    width: var(--composer-width);
    bottom: var(--composer-bottom);
  }

  .composer {
    min-height: 124px;
    padding: 14px 14px 10px;
    border-radius: 22px;
  }

  .email-code-row {
    grid-template-columns: 1fr;
  }

  .code-send-btn {
    width: 100%;
  }

  .prompt {
    font-size: 16px;
    max-height: 128px;
  }

  .composer-actions {
    gap: 8px;
  }

  .icon-btn,
  .generate-btn {
    width: 42px;
    height: 42px;
  }

  .add-menu {
    left: -2px;
    bottom: 50px;
    width: min(232px, calc(100vw - 18px));
    max-height: min(318px, calc(100dvh - 210px));
    overflow-y: auto;
  }

  .menu-select-trigger {
    min-width: 0;
    height: 38px;
    padding-left: 9px;
    padding-right: 28px;
    font-size: 12.5px;
  }

  .menu-action {
    height: 38px;
    font-size: 12.5px;
  }

  .menu-select-trigger > [data-select-label] {
    max-width: 34vw;
    font-size: 12.5px;
  }

  .menu-select .select-menu {
    position: static;
    width: 100%;
    max-height: 152px;
    margin: 2px 0 6px;
    box-shadow: none;
    border-radius: 10px;
    background: var(--surface-soft);
    transform: none;
  }

  .select-wrap.menu-select::after {
    top: 19px;
    transform: translateY(-65%) rotate(45deg);
  }

  .menu-select.open .menu-select-trigger {
    background: var(--surface-soft);
    border-color: var(--border);
  }

  .menu-select.open::after {
    transform: translateY(-35%) rotate(225deg);
  }

  .preview-modal {
    align-items: stretch;
    padding: 10px;
  }

  .preview-panel {
    width: 100%;
    height: calc(100dvh - 20px);
  }

  .preview-stage {
    align-items: center;
    justify-content: center;
  }

  .preview-image-wrap {
    max-width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 166px);
    max-height: calc(100dvh - 166px);
  }

  .preview-stage img {
    max-width: 100%;
    max-height: inherit;
    border-radius: 10px;
  }

  .preview-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    min-height: auto;
    padding-top: 10px;
  }

  .preview-actions div {
    justify-content: flex-end;
  }

  .toast-stack {
    bottom: calc(var(--composer-bottom, 10px) + 190px);
    width: calc(100vw - 32px);
  }
}

@media (max-width: 980px) {
  .auth-wall-shell {
    padding: 86px 18px 34px;
  }

  .auth-wall-tile {
    opacity: 0.72;
  }

  .auth-wall-tile.left-3,
  .auth-wall-tile.left-5,
  .auth-wall-tile.right-2,
  .auth-wall-tile.right-4 {
    display: none;
  }

  .auth-wall-card {
    width: min(100%, 430px);
  }

  .auth-wall-card-register {
    width: min(100%, 470px);
  }

  .auth-wall-intro {
    width: min(620px, calc(100vw - 48px));
  }

  .auth-wall-intro h1 {
    font-size: clamp(58px, 12vw, 96px);
  }
}

@media (max-width: 700px) {
  body.auth-wall-body {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-wall-shell {
    height: 100svh;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y;
    padding: 92px 16px 28px;
    align-items: center;
    background:
      radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.28), transparent 34%),
      linear-gradient(180deg, #090909 0%, #1b1b1a 42%, #111110 100%);
  }

  .auth-wall-shell::before {
    background:
      radial-gradient(ellipse at 50% 31%, rgba(255, 255, 255, 0.58) 0 16%, rgba(255, 255, 255, 0.2) 34%, transparent 58%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 35%, rgba(255, 255, 255, 0.52) 100%);
  }

  .auth-wall-shell::after {
    backdrop-filter: blur(1px);
    mask-image: linear-gradient(180deg, #000 0 38%, transparent 72%);
  }

  .auth-wall-gallery {
    inset: -2vh -30vw;
    perspective: 1000px;
    transform: scale(0.86);
    transform-origin: 50% 50%;
  }

  .auth-wall-brand {
    top: 18px;
    left: 16px;
    right: 16px;
    gap: 13px;
    color: rgba(255, 255, 255, 0.9);
  }

  .auth-wall-brand-mark {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }

  .auth-wall-brand-name {
    min-width: 0;
    font-size: 11px;
    letter-spacing: 0.22em;
    white-space: normal;
    line-height: 1.35;
  }

  .auth-wall-language {
    top: 18px;
    right: 14px;
    min-height: 32px;
    padding: 0 8px;
    background: rgba(0, 0, 0, 0.16);
  }

  .auth-wall-tile {
    opacity: 0.5;
    --tile-shadow-strong: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.34));
    --tile-shadow-close: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.26));
    --scroll-x: 0px;
    --scroll-y: -48px;
    --scroll-duration: 18s;
    min-width: 0;
  }

  .auth-wall-tile.left-1,
  .auth-wall-tile.left-2,
  .auth-wall-tile.left-3,
  .auth-wall-tile.left-4,
  .auth-wall-tile.left-5,
  .auth-wall-tile.left-6,
  .auth-wall-tile.left-7,
  .auth-wall-tile.right-1,
  .auth-wall-tile.right-2,
  .auth-wall-tile.right-3,
  .auth-wall-tile.right-4,
  .auth-wall-tile.right-5,
  .auth-wall-tile.right-6 {
    display: block;
    min-width: 0;
  }

  .auth-wall-tile.left-1 {
    left: 11vw;
    top: 8vh;
    width: 34vw;
  }

  .auth-wall-tile.left-2 {
    left: 32vw;
    top: 1vh;
    width: 31vw;
  }

  .auth-wall-tile.left-3 {
    left: 52vw;
    top: 12vh;
    width: 28vw;
    opacity: 0.34;
  }

  .auth-wall-tile.left-4 {
    left: 8vw;
    top: 32vh;
    width: 37vw;
  }

  .auth-wall-tile.left-5 {
    left: 40vw;
    top: 46vh;
    width: 28vw;
    opacity: 0.44;
  }

  .auth-wall-tile.left-6 {
    left: 14vw;
    bottom: 7vh;
    width: 32vw;
  }

  .auth-wall-tile.left-7 {
    left: 55vw;
    bottom: 2vh;
    width: 27vw;
    opacity: 0.42;
  }

  .auth-wall-tile.right-1 {
    right: 10vw;
    top: 6vh;
    width: 30vw;
  }

  .auth-wall-tile.right-2 {
    right: 34vw;
    top: 0;
    width: 29vw;
    opacity: 0.46;
  }

  .auth-wall-tile.right-3 {
    right: 8vw;
    top: 30vh;
    width: 35vw;
  }

  .auth-wall-tile.right-4 {
    right: 40vw;
    top: 37vh;
    width: 27vw;
    opacity: 0.32;
  }

  .auth-wall-tile.right-5 {
    right: 24vw;
    bottom: 9vh;
    width: 28vw;
    opacity: 0.44;
  }

  .auth-wall-tile.right-6 {
    right: 9vw;
    bottom: 4vh;
    width: 35vw;
  }

  .auth-wall-haze {
    filter: blur(16px);
    background:
      radial-gradient(ellipse at 50% 39%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.16) 34%, transparent 60%);
  }

  .auth-wall-card {
    width: min(100%, 390px);
    max-height: calc(100svh - 116px);
    overflow-y: auto;
    margin: 0 auto;
    padding: 24px 18px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
      0 28px 74px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  }

  .auth-wall-card-register {
    width: min(100%, 400px);
  }

  .auth-wall-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
  }

  .auth-wall-logo {
    width: 46px;
    height: 46px;
    margin-bottom: 16px;
    font-size: 24px;
  }

  .auth-wall-card h2 {
    font-size: 30px;
  }

  .auth-wall-panel > p {
    margin: 6px 0 20px;
    font-size: 13px;
  }

  .auth-wall-form .field {
    margin-bottom: 13px;
  }

  .auth-wall-input,
  .auth-wall-code-btn {
    min-height: 44px;
  }

  .auth-wall-submit,
  .auth-wall-outline {
    min-height: 46px;
  }

  .auth-wall-split {
    margin: 16px 0;
  }

  .auth-wall-intro {
    width: min(430px, calc(100vw - 32px));
  }

  .auth-wall-intro h1 {
    font-size: clamp(48px, 15vw, 68px);
    line-height: 0.92;
  }

  .auth-wall-start {
    min-width: 132px;
    min-height: 48px;
    margin-top: 24px;
    font-size: 12px;
  }

  .auth-wall-email-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-wall-code-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 390px) {
  .auth-wall-shell {
    padding: 82px 12px 22px;
  }

  .auth-wall-brand-mark {
    width: 40px;
    height: 40px;
    font-size: 19px;
  }

  .auth-wall-brand-name {
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  .auth-wall-card {
    padding: 20px 14px 16px;
  }

  .auth-wall-card h2 {
    font-size: 28px;
  }

  .auth-wall-panel > p {
    margin-bottom: 18px;
  }

  .auth-wall-intro h1 {
    font-size: clamp(44px, 16vw, 62px);
  }
}
