:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --ink: #141719;
  --muted: #667176;
  --faint: #9aa5a9;
  --panel: rgba(255, 255, 255, 0.62);
  --panel-strong: rgba(255, 255, 255, 0.84);
  --line: rgba(30, 43, 48, 0.1);
  --line-light: rgba(255, 255, 255, 0.72);
  --teal: #0b8f90;
  --aqua: #66d6d2;
  --blue: #6d8df7;
  --coral: #ef8576;
  --amber: #e7bd58;
  --shadow-xs: 0 1px 2px rgba(16, 30, 34, 0.05);
  --shadow-sm: 0 14px 38px rgba(16, 30, 34, 0.09);
  --shadow-md: 0 28px 80px rgba(16, 30, 34, 0.17);
  --display-font: "Alibaba PuHuiTi H", "Alibaba PuHuiTi Heavy", "Alibaba PuHuiTi 3.0 105 Heavy", "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(102, 214, 210, 0.28), transparent 34%),
    radial-gradient(circle at 88% 0%, rgba(239, 133, 118, 0.22), transparent 32%),
    linear-gradient(180deg, #fbfcfb, var(--bg));
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

body.detail-modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gallery-app {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 42px) 56px;
}

.gallery-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: 4px;
  padding-bottom: 18px;
}

.top-nav {
  display: grid;
  grid-template-columns: auto minmax(260px, 520px) auto;
  gap: 18px;
  align-items: center;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.52)),
    rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 30px rgba(16, 30, 34, 0.13);
  overflow: visible;
}

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

.logo-p {
  fill: url(#logoFlow);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 42px;
  font-weight: 900;
}


.logo-orbit {
  fill: rgba(239, 133, 118, 0.82);
}

.brand h1,
.brand p,
.hero-panel h2,
.hero-panel p,
.stats-row p,
.gallery-card h3,
.gallery-card p,
.detail-info h2,
.detail-info p,
.detail-section h3 {
  margin: 0;
}

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

.brand p {
  color: var(--muted);
  font-size: 12px;
}

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

.nav-actions input {
  display: none;
}

.data-menu {
  position: relative;
}

.data-menu summary {
  list-style: none;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  min-width: 76px;
}

.data-menu summary::-webkit-details-marker {
  display: none;
}

.data-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.68;
}

.data-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  min-width: 230px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-light);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.52)),
    rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(22px) saturate(160%);
}

.data-menu-panel button,
.data-menu-panel label {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #334044;
  padding: 10px 12px;
  text-align: left;
  font-weight: 780;
  cursor: pointer;
}

.data-menu-panel button:hover,
.data-menu-panel label:hover {
  background: rgba(11, 143, 144, 0.09);
  color: var(--teal);
}

.data-menu-status {
  max-width: 260px;
  margin: 2px 4px 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(220, 252, 252, 0.72), rgba(255, 255, 255, 0.58));
  color: #526064;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.55;
}

.data-menu-panel .hidden {
  display: none !important;
}

.floating-add {
  position: fixed;
  right: clamp(20px, 3vw, 42px);
  bottom: clamp(20px, 3vw, 42px);
  z-index: 20;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, rgba(11, 143, 144, 0.94), rgba(109, 141, 247, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 22px 48px rgba(11, 143, 144, 0.24);
  font-size: 38px;
  font-weight: 520;
  line-height: 1;
  backdrop-filter: blur(18px) saturate(150%);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.floating-add:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 26px 56px rgba(11, 143, 144, 0.3);
}


.ocr-tools input {
  display: none;
}

.primary-action,
.ghost,
.text-button,
.file-button,
.type-tabs button,
.tag-rail button,
.icon-button,
.favorite-button {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
  backdrop-filter: blur(18px) saturate(150%);
}

.primary-action::before,
.ghost::before,
.text-button::before,
.file-button::before,
.type-tabs button::before,
.tag-rail button::before,
.icon-button::before,
.favorite-button::before,
.stats-row article::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.primary-action {
  min-height: 42px;
  color: white;
  background: linear-gradient(135deg, rgba(11, 143, 144, 0.94), rgba(109, 141, 247, 0.84));
  padding: 10px 16px;
  font-weight: 850;
  box-shadow: 0 16px 38px rgba(11, 143, 144, 0.18);
}

.ghost,
.file-button,
.text-button {
  min-height: 38px;
  padding: 9px 13px;
  color: #334044;
  background: rgba(255, 255, 255, 0.48);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-xs);
  font-weight: 760;
}

.primary-action:hover,
.ghost:hover,
.file-button:hover,
.text-button:hover,
.type-tabs button:hover,
.tag-rail button:hover {
  transform: translateY(-1px);
}

.compact {
  padding: 10px 18px;
}

.search-box {
  display: grid;
  gap: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.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;
}

.search-box input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  padding: 12px 15px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 14px 32px rgba(16, 30, 34, 0.06);
  backdrop-filter: blur(20px) saturate(145%);
}

.form-grid textarea {
  border-radius: 22px;
}

.search-box input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: rgba(102, 214, 210, 0.88);
  box-shadow:
    0 0 0 4px rgba(102, 214, 210, 0.16),
    0 18px 38px rgba(16, 30, 34, 0.1);
}

.hero-panel {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 24px;
  align-items: center;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-title-text {
  max-width: none;
  font-family: var(--display-font);
  font-size: clamp(34px, 3.3vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 900;
  white-space: nowrap;
  color: #101719;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.68),
    0 18px 44px rgba(18, 28, 32, 0.1);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stats-row article {
  position: relative;
  overflow: hidden;
  min-height: 82px;
  border: 1px solid var(--line-light);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.36)),
    rgba(255, 255, 255, 0.48);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(24px) saturate(160%);
}

.stats-row span {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.stats-row p {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filter-bar {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.type-tabs,
.tag-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.type-tabs button,
.tag-rail button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  color: #334044;
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-xs);
  font-weight: 780;
}

.type-tabs button.active,
.tag-rail button.active {
  color: white;
  border-color: rgba(255, 255, 255, 0.76);
  background: linear-gradient(135deg, rgba(11, 143, 144, 0.82), rgba(102, 214, 210, 0.7));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    inset 0 -10px 22px rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(11, 143, 144, 0.08);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  grid-auto-flow: dense;
  gap: 18px;
  align-items: stretch;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid var(--line-light);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.54);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  backdrop-filter: blur(22px) saturate(150%);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 214, 210, 0.82);
  box-shadow: var(--shadow-md);
}

.gallery-card.span-2,
.gallery-card.span-4 {
  min-height: 500px;
}

.gallery-card.span-3 {
  min-height: 460px;
}

.card-media {
  position: relative;
  height: 58%;
  min-height: 230px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.34);
}

.gallery-card.span-2 .card-media {
  height: 64%;
}

.gallery-card.span-4 .card-media {
  height: 68%;
}

.card-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.32));
  pointer-events: none;
}

.card-media img,
.card-media video,
.detail-media img,
.detail-media video,
.media-preview-wrap {
  width: 100%;
  height: 100%;
}

.card-media img,
.card-media video,
.detail-media img,
.detail-media video {
  display: block;
  object-fit: cover;
}

.media-preview-wrap {
  position: relative;
}

.card-content {
  display: grid;
  gap: 11px;
  padding: 17px 18px 18px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.card-type,
.detail-type {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(102, 214, 210, 0.15);
  color: #087178;
  font-size: 12px;
  font-weight: 900;
}

.gallery-card h3 {
  font-size: 19px;
  line-height: 1.25;
}

.favorite-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: #aa7b1f;
  background: rgba(255, 255, 255, 0.52);
  border-color: var(--line-light);
  box-shadow: var(--shadow-xs);
  font-size: 20px;
}

.favorite-button.active {
  color: #734c00;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(231, 189, 88, 0.54));
}

.use-case,
.prompt-preview {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.use-case {
  color: #23736f;
  font-weight: 820;
}

.prompt-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.card-tags span,
.detail-tags span {
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  color: #596468;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 760;
}

.media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
  color: white;
  background:
    linear-gradient(135deg, rgba(11, 143, 144, 0.92), rgba(109, 141, 247, 0.78), rgba(239, 133, 118, 0.68)),
    var(--teal);
  font-size: 18px;
  font-weight: 900;
}

.empty-state {
  margin-top: 46px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.detail-modal,
.modal,
.preview-modal {
  border: 1px solid var(--line-light);
  border-radius: 32px;
  padding: 0;
  background: transparent;
  box-shadow: 0 30px 90px rgba(12, 35, 40, 0.28);
  overflow: hidden;
}

.detail-modal {
  width: min(1180px, calc(100vw - 28px));
  max-height: calc(100dvh - 72px);
  position: relative;
  overflow: visible;
  border: 0;
  box-shadow: none;
}

.detail-close-button {
  position: absolute;
  top: clamp(-34px, -2.8vw, -24px);
  right: clamp(-72px, -4.8vw, -48px);
  z-index: 12;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  color: rgba(20, 31, 34, 0.82);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.46)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    0 18px 42px rgba(24, 54, 62, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -10px 22px rgba(104, 210, 207, 0.12);
  backdrop-filter: blur(18px) saturate(170%);
  cursor: pointer;
  font-size: 0;
  line-height: 1;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
  outline: none;
}

.detail-close-button::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, rgba(232, 255, 252, 0.96), rgba(132, 226, 255, 0.72), rgba(169, 188, 255, 0.84), rgba(255, 255, 255, 0.9));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.detail-close-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  background:
    linear-gradient(currentColor, currentColor) center / 2px 17px no-repeat,
    linear-gradient(currentColor, currentColor) center / 17px 2px no-repeat;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.detail-close-button:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(91, 207, 205, 0.78), rgba(105, 145, 246, 0.72)),
    rgba(255, 255, 255, 0.68);
  box-shadow:
    0 22px 54px rgba(35, 116, 130, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: white;
}

.detail-close-button:hover::before {
  opacity: 1;
}

.modal {
  width: min(780px, calc(100vw - 28px));
}

.preview-modal {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
}

.detail-modal::backdrop,
.modal::backdrop,
.preview-modal::backdrop {
  background: rgba(18, 28, 32, 0.48);
  backdrop-filter: blur(12px);
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  max-height: min(760px, calc(100dvh - 108px));
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: 32px;
  box-shadow: 0 30px 90px rgba(12, 35, 40, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.46)),
    rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(28px) saturate(165%);
}

.detail-media {
  position: relative;
  min-height: min(620px, calc(100dvh - 108px));
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(11, 143, 144, 0.88), rgba(109, 141, 247, 0.72), rgba(239, 133, 118, 0.6)),
    rgba(255, 255, 255, 0.34);
}

.detail-media.is-clickable {
  cursor: zoom-in;
}

.preview-badge {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  color: white;
  background: rgba(15, 22, 28, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(16px) saturate(150%);
  font-size: 12px;
  font-weight: 850;
}

.detail-info {
  position: relative;
  max-height: inherit;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 24px 10px 24px 24px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 166, 166, 0.48) transparent;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-info::-webkit-scrollbar {
  width: 8px;
}

.detail-info::-webkit-scrollbar-track {
  margin: 18px 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.detail-info::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(96, 214, 210, 0.64), rgba(104, 142, 247, 0.52));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 18px rgba(11, 143, 144, 0.14);
}

.detail-info::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(72, 198, 197, 0.92), rgba(85, 128, 236, 0.74));
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.detail-header h2 {
  font-size: 30px;
  line-height: 1.12;
}

.detail-use-case {
  color: #23736f;
  font-weight: 820;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title h3 {
  color: var(--faint);
  font-size: 13px;
  text-transform: uppercase;
}

.detail-section pre,
.detail-section p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line-light);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow-xs);
  padding: 14px;
  color: #2b3336;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}

.modal form,
.preview-shell {
  padding: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.48)),
    rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(26px) saturate(160%);
}

.preview-shell {
  padding: 18px;
}

.modal-header,
.modal-actions,
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modal-header,
.preview-header {
  margin-bottom: 20px;
}

.preview-header {
  margin-bottom: 14px;
}

.modal-header h2,
.preview-header h2 {
  margin: 0;
  font-size: 25px;
}

.preview-header h2 {
  font-size: 22px;
}

.icon-button {
  width: 40px;
  height: 40px;
  font-size: 25px;
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  border-color: var(--line-light);
}

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

.hidden-field {
  display: none !important;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ocr-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-light);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow-xs);
  padding: 12px;
}

.ocr-tools div {
  display: grid;
  gap: 4px;
}

.ocr-tools strong {
  color: var(--ink);
  font-size: 14px;
}

.ocr-tools span {
  color: var(--muted);
  font-size: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid textarea {
  min-height: 122px;
  resize: vertical;
}

.modal-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
}

.danger {
  color: #92362d;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(239, 133, 118, 0.2));
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 280px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 24px;
  background: rgba(12, 24, 28, 0.12);
}

.preview-stage img,
.preview-stage video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 172px);
  object-fit: contain;
  border-radius: 20px;
}

@media (max-width: 980px) {
  .top-nav,
  .hero-panel,
  .detail-shell {
    grid-template-columns: 1fr;
  }

  .hero-title-text {
    font-size: 42px;
    white-space: normal;
  }

  .nav-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .detail-media {
    min-height: min(420px, calc(100dvh - 108px));
  }
}

@media (max-width: 620px) {
  .detail-close-button {
    top: -24px;
    right: -10px;
    width: 42px;
    height: 42px;
  }

  .gallery-app {
    padding: 16px 12px 36px;
  }

  .gallery-header {
    position: static;
  }

  .hero-title-text {
    font-size: 32px;
  }

  .stats-row,
  .form-grid,
  .detail-actions,
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}


/* Workbench feature additions */
.collection-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}
.collection-rail button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #334044;
  font-weight: 760;
}
.collection-rail button.active {
  color: white;
  background: linear-gradient(135deg, rgba(11, 143, 144, 0.82), rgba(102, 214, 210, 0.7));
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.meta-grid div,
.detail-section pre,
.detail-section p {
  backdrop-filter: blur(18px) saturate(145%);
}
.meta-grid div {
  border: 1px solid var(--line-light);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  padding: 9px 10px;
  display: grid;
  gap: 4px;
}
.meta-grid span {
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
}
.meta-grid strong {
  color: #263033;
  font-size: 13px;
  font-weight: 780;
  word-break: break-word;
}
.copy-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.copy-group .text-button {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}
.template-vars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.template-vars label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}
.template-vars input {
  border: 1px solid var(--line-light);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
  padding: 9px 10px;
  outline: none;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.compare-item {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line-light);
  border-radius: 16px;
  padding: 0;
  background: rgba(255, 255, 255, 0.4);
}
.version-list {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.version-list button {
  border: 1px solid var(--line-light);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  color: #334044;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}
.ocr-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-light);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow-xs);
  padding: 12px;
}
.ocr-tools input,
#batchOcrInput {
  display: none;
}
.ocr-tools div {
  display: grid;
  gap: 4px;
}
.ocr-tools strong {
  color: var(--ink);
  font-size: 14px;
}
.ocr-tools span {
  color: var(--muted);
  font-size: 12px;
}
.form-grid textarea {
  min-height: 96px;
}
@media (max-width: 620px) {
  .meta-grid,
  .template-vars,
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .ocr-tools {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Scroll overlap fix */
.gallery-header {
  position: relative;
  top: auto;
  z-index: 1;
  isolation: isolate;
}

.type-tabs,
.tag-rail,
.collection-rail {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  -ms-overflow-style: auto;
}

.type-tabs::-webkit-scrollbar,
.tag-rail::-webkit-scrollbar,
.collection-rail::-webkit-scrollbar {
  height: 7px;
  display: block;
}

.filter-bar {
  position: relative;
  z-index: 1;
}

.gallery-grid {
  position: relative;
  z-index: 0;
}

/* Unified filter button sizing */
.type-tabs button,
.tag-rail button,
.collection-rail button {
  min-height: 38px;
  padding: 8px 14px;
  line-height: 1;
  font-size: 15px;
  font-weight: 780;
  box-shadow: var(--shadow-xs);
}

.collection-rail button.active {
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    inset 0 -10px 22px rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(11, 143, 144, 0.08);
}

/* Card typography refinement */
.card-content {
  gap: 12px;
  padding: 18px 20px 20px;
}

.card-title-row {
  align-items: flex-start;
  gap: 14px;
}

.card-title-row > div {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.card-type {
  margin-bottom: 0;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
}

.gallery-card h3 {
  max-width: 100%;
  font-size: 18px;
  line-height: 1.38;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.use-case {
  margin-top: -1px;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0;
}

.prompt-preview {
  font-size: 14px;
  line-height: 1.62;
  letter-spacing: 0;
  color: #68747a;
}

.card-tags {
  gap: 8px 12px;
  padding-top: 2px;
}

.card-tags span {
  padding: 0;
  border: 0;
  background: transparent;
  color: #516066;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0;
  font-weight: 760;
}

.favorite-button {
  margin-top: 4px;
}

/* Card spacing correction */
.gallery-card {
  display: flex;
  flex-direction: column;
}

.card-media {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1.12;
}

.gallery-card.span-2 .card-media,
.gallery-card.span-4 .card-media {
  height: auto;
  aspect-ratio: 1 / 1.22;
}

.gallery-card.span-3 .card-media {
  height: auto;
  aspect-ratio: 1 / 1.08;
}

.card-content {
  flex: 1 1 auto;
  align-content: start;
  gap: 13px;
  padding: 20px 22px 26px;
}

.card-title-row > div {
  gap: 8px;
}

.gallery-card h3,
.use-case,
.prompt-preview,
.card-tags span {
  letter-spacing: 0;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

.gallery-card h3 {
  font-size: 18px;
  line-height: 1.42;
}

.prompt-preview {
  -webkit-line-clamp: 3;
  line-height: 1.68;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding-top: 4px;
  margin-top: auto;
  align-items: center;
}

.card-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(30, 43, 48, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  color: #4e5c61;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

/* Bottom pinned card tags */
.card-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
}

.card-title-row,
.use-case,
.prompt-preview,
.card-tags {
  min-width: 0;
}

.prompt-preview {
  display: block;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  align-self: stretch;
  mask-image: linear-gradient(180deg, #000 76%, transparent 100%);
}

.card-tags {
  align-self: end;
  margin-top: 8px;
  padding-top: 8px;
}

.gallery-card.span-2 .prompt-preview,
.gallery-card.span-4 .prompt-preview {
  line-height: 1.7;
}

/* Compact prompt preview area */
.card-content {
  grid-template-rows: auto auto auto 1fr auto;
}

.prompt-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  align-self: start;
  max-height: calc(1.68em * 5);
  mask-image: none;
}

.gallery-card.span-2 .prompt-preview,
.gallery-card.span-4 .prompt-preview {
  -webkit-line-clamp: 4;
  max-height: calc(1.7em * 4);
}

.gallery-card.span-3 .prompt-preview {
  -webkit-line-clamp: 5;
  max-height: calc(1.68em * 5);
}

.card-tags {
  grid-row: 5;
}

/* Uniform 3 by 4 card ratio */
.gallery-card,
.gallery-card.span-2,
.gallery-card.span-3,
.gallery-card.span-4 {
  aspect-ratio: 3 / 4;
  min-height: 0;
  height: auto;
}

.card-media,
.gallery-card.span-2 .card-media,
.gallery-card.span-3 .card-media,
.gallery-card.span-4 .card-media {
  flex: 0 0 46%;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
}

.card-content {
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: 16px 18px 18px;
}

.prompt-preview,
.gallery-card.span-2 .prompt-preview,
.gallery-card.span-3 .prompt-preview,
.gallery-card.span-4 .prompt-preview {
  -webkit-line-clamp: 3;
  max-height: calc(1.68em * 3);
}

.card-tags {
  grid-row: auto;
  align-self: end;
  margin-top: 6px;
  padding-top: 6px;
}

/* Two height previews with protected tags */
.gallery-card,
.gallery-card.span-2,
.gallery-card.span-3,
.gallery-card.span-4 {
  aspect-ratio: 3 / 4;
  display: grid;
  grid-template-rows: var(--preview-height, 42%) minmax(0, 1fr);
  min-height: 0;
  height: auto;
}

.gallery-card.span-1,
.gallery-card.span-3 {
  --preview-height: 46%;
}

.gallery-card.span-2,
.gallery-card.span-4 {
  --preview-height: 36%;
}

.card-media,
.gallery-card.span-2 .card-media,
.gallery-card.span-3 .card-media,
.gallery-card.span-4 .card-media {
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: none;
  aspect-ratio: auto;
}

.card-content {
  grid-row: 2;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 7px;
  padding: 14px 18px 18px;
}

.card-title-row {
  min-height: 0;
}

.gallery-card h3 {
  font-size: 17px;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.use-case {
  font-size: 13px;
  line-height: 1.35;
}

.prompt-preview,
.gallery-card.span-2 .prompt-preview,
.gallery-card.span-3 .prompt-preview,
.gallery-card.span-4 .prompt-preview {
  min-height: 0;
  align-self: start;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  max-height: calc(1.5em * 2);
}

.gallery-card.span-2 .prompt-preview,
.gallery-card.span-4 .prompt-preview {
  -webkit-line-clamp: 3;
  max-height: calc(1.5em * 3);
}

.card-tags {
  align-self: end;
  min-height: 24px;
  max-height: 52px;
  overflow: hidden;
  gap: 6px 8px;
  margin-top: 4px;
  padding-top: 4px;
}

.card-tags span {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

/* Identity workspace system */
.identity-bar {
  display: grid;
  grid-template-columns: auto minmax(220px, 320px) auto minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  background: rgba(255,255,255,.36);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 16px 36px rgba(31,53,59,.06);
  backdrop-filter: blur(22px) saturate(145%);
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 12px 6px 7px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 999px;
  background: rgba(255,255,255,.46);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.72);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--aqua), var(--blue) 58%, var(--coral));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.profile-chip strong,
.profile-chip small {
  display: block;
  line-height: 1.15;
  letter-spacing: 0;
}

.profile-chip strong {
  font-size: 14px;
}

.profile-chip small,
.workspace-picker span,
.workspace-summary {
  color: var(--muted);
  font-size: 12px;
}

.workspace-picker {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.workspace-picker select,
#workspaceField {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 999px;
  padding: 0 14px;
  color: #263033;
  background: rgba(255,255,255,.58);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.workspace-summary {
  margin: 0;
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .identity-bar {
    grid-template-columns: 1fr;
  }

  .workspace-summary {
    justify-self: start;
    white-space: normal;
  }
}

/* Workspace summary refinement */
.identity-bar {
  grid-template-columns: auto minmax(220px, 320px) auto minmax(320px, 1fr);
}

.workspace-picker {
  display: flex;
  align-items: center;
}

.workspace-picker select {
  width: 100%;
}

.workspace-summary {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
  color: #526066;
  font-size: 12px;
  line-height: 1;
}

.workspace-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.workspace-summary strong {
  margin-right: 4px;
  color: #1f2a2e;
  font-size: 13px;
  font-weight: 860;
}

.workspace-summary .summary-workspace {
  max-width: 180px;
  color: #253033;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 860px) {
  .workspace-summary {
    justify-self: start;
    flex-wrap: wrap;
    white-space: normal;
  }
}

/* Custom workspace dropdown */
.workspace-picker {
  position: relative;
}

.native-workspace-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.workspace-combobox {
  position: relative;
  width: 100%;
}

.workspace-menu-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 15px 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,255,255,.42)),
    rgba(255,255,255,.5);
  color: #253033;
  font-weight: 760;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.76), 0 12px 26px rgba(31,53,59,.07);
  backdrop-filter: blur(18px) saturate(145%);
}

.workspace-menu-button span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-menu-arrow {
  width: 8px;
  height: 8px;
  border-right: 2px solid #536166;
  border-bottom: 2px solid #536166;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
  justify-self: center;
}

.workspace-menu-button[aria-expanded="true"] .workspace-menu-arrow {
  transform: translateY(2px) rotate(225deg);
}

.workspace-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.88), rgba(255,255,255,.62)),
    rgba(255,255,255,.72);
  box-shadow: 0 24px 60px rgba(16, 30, 34, .16), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(24px) saturate(155%);
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.workspace-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.workspace-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #2d383d;
  text-align: left;
  font-weight: 760;
}

.workspace-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-option small {
  color: #7a8589;
  font-size: 11px;
  font-weight: 760;
}

.workspace-option:hover,
.workspace-option.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(11,143,144,.82), rgba(102,214,210,.72) 52%, rgba(109,141,247,.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42), 0 10px 20px rgba(11,143,144,.12);
}

.workspace-option:hover small,
.workspace-option.active small {
  color: rgba(255,255,255,.82);
}

/* Workspace dropdown layering fix */
.gallery-header {
  position: relative;
  z-index: 120;
  overflow: visible;
}

.identity-bar {
  position: relative;
  z-index: 140;
  overflow: visible;
}

.workspace-picker,
.workspace-combobox {
  position: relative;
  z-index: 150;
  overflow: visible;
}

.workspace-menu {
  z-index: 999;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hero-panel,
.filter-bar {
  position: relative;
  z-index: 1;
}

/* Language toggle */
.language-toggle {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  color: #253033;
  background:
    linear-gradient(145deg, rgba(255,255,255,.68), rgba(255,255,255,.38)),
    rgba(255,255,255,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.76), 0 10px 22px rgba(31,53,59,.06);
  backdrop-filter: blur(18px) saturate(145%);
  font-size: 13px;
  font-weight: 860;
  letter-spacing: 0;
  white-space: nowrap;
}

.language-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(102, 214, 210, 0.82);
}


/* Launch readiness polish */
.backup-note {
  max-width: 240px;
  margin: 4px 6px 2px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #667176;
  background: rgba(255,255,255,.48);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .gallery-app {
    padding-inline: 14px;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .hero-panel {
    gap: 14px;
  }

  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-row article {
    min-height: 72px;
    padding: 14px;
  }

  .identity-bar {
    padding: 9px;
    border-radius: 20px;
  }

  .gallery-grid {
    gap: 14px;
  }
}


/* Data menu top layer fix */
.top-nav {
  position: relative;
  z-index: 260;
  overflow: visible;
}

.nav-actions,
.data-menu {
  position: relative;
  z-index: 320;
}

.data-menu-panel {
  z-index: 2000;
}


/* Cloud sync */
.cloud-status {
  min-height: 42px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 16px;
  background: rgba(255,255,255,.48);
  color: #4f5d61;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.5;
}

.cloud-status.error {
  color: #9f3129;
  background: rgba(255, 235, 231, .72);
  border-color: rgba(239, 133, 118, .42);
}

.cloud-actions {
  grid-template-columns: repeat(5, auto);
  justify-content: end;
}

@media (max-width: 720px) {
  .cloud-actions {
    grid-template-columns: 1fr;
  }
}


/* Community publishing and ranking */
.auth-entry.signed-in {
  color: #087c7f;
  border-color: rgba(102, 214, 210, 0.48);
  background: rgba(255, 255, 255, 0.62);
}

.leaderboard-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.56), rgba(255,255,255,0.24));
  box-shadow: 0 24px 70px rgba(40, 60, 70, 0.10);
  backdrop-filter: blur(22px) saturate(1.25);
  position: relative;
  z-index: 2;
}

.leaderboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.leaderboard-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.leaderboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  color: #172025;
  background: rgba(255, 255, 255, 0.58);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(50, 65, 70, 0.08);
}

.rank-index {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #2fc6bd, #6d8df7);
}

.rank-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rank-main strong,
.rank-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-main small,
.leaderboard-empty {
  color: #5f6b70;
  font-size: 12px;
}

.card-rating {
  width: 100%;
  min-height: 30px;
  align-self: end;
  margin-top: 8px;
  padding-top: 6px;
}

.rating-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.rating-summary {
  min-width: 0;
  padding-right: 10px;
  color: #607077;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-stars {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex: 0 0 auto;
}

.rating-stars button {
  width: 19px;
  height: 19px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(168, 116, 21, 0.58);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.rating-stars button.active,
.rating-stars button:hover {
  color: #b97908;
  background: rgba(255, 236, 180, 0.52);
}

.nav-actions,
.data-menu,
.data-menu-panel {
  z-index: 5000;
}

@media (max-width: 720px) {
  .leaderboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-list {
    grid-template-columns: 1fr;
  }

  .rating-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .rating-stars {
    justify-content: flex-start;
  }
}


/* Profile center */
.profile-center-modal {
  width: min(960px, calc(100vw - 28px));
}

.profile-center-modal form {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.profile-center-header {
  margin-bottom: 14px;
}

.profile-overview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: rgba(255,255,255,.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.profile-overview-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--aqua), var(--blue) 58%, var(--coral));
}

.profile-overview-main,
.profile-overview-stats span,
.profile-mini-body {
  display: grid;
  min-width: 0;
}

.profile-overview-main strong {
  font-size: 17px;
}

.profile-overview-main span,
.profile-overview-stats small,
.profile-mini-body small,
.profile-mini-body span,
.profile-center-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.profile-overview-stats {
  display: flex;
  gap: 10px;
  text-align: center;
}

.profile-overview-stats span {
  min-width: 58px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.54);
  border: 1px solid rgba(255,255,255,.72);
}

.profile-overview-stats strong {
  font-size: 18px;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  color: #334044;
  font-weight: 800;
  background: rgba(255,255,255,.48);
  cursor: pointer;
}

.profile-tabs button.active {
  color: #fff;
  border-color: rgba(102,214,210,.54);
  background: linear-gradient(135deg, #2fc6bd, #6d8df7);
  box-shadow: 0 10px 28px rgba(47, 198, 189, 0.22);
}

.profile-center-status {
  min-height: 18px;
  margin: 0 0 10px;
}

.profile-center-status.error {
  color: #b85046;
}

.profile-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  min-height: 120px;
}

.profile-mini-card,
.profile-empty-card {
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 20px;
  background: rgba(255,255,255,.56);
  box-shadow: 0 14px 34px rgba(27, 44, 49, 0.08);
}

.profile-mini-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.profile-mini-media {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.profile-mini-media .media-placeholder,
.profile-mini-media img,
.profile-mini-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-mini-body {
  gap: 4px;
  align-content: center;
}

.profile-mini-body strong,
.profile-mini-body small,
.profile-mini-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-empty-card {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 118px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.profile-settings-actions {
  margin-top: 14px;
}

.favorite-button,
.rating-stars button {
  display: inline-grid;
  place-items: center;
}

.star-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.favorite-button .star-icon {
  width: 18px;
  height: 18px;
}

.rating-stars button {
  color: rgba(168, 116, 21, 0.62);
}

.rating-stars button.active,
.rating-stars button:hover,
.favorite-button.active {
  color: #b97908;
}

@media (max-width: 720px) {
  .profile-overview {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-overview-stats {
    grid-column: 1 / -1;
    width: 100%;
  }

  .profile-overview-stats span {
    flex: 1;
  }

  .profile-card-list {
    grid-template-columns: 1fr;
  }
}


/* Prompt editor scroll area */
#promptModal {
  overflow: hidden;
}

#promptModal form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.82), rgba(244,250,250,.48) 48%, rgba(255,246,244,.42)),
    rgba(255,255,255,.58);
  backdrop-filter: blur(28px) saturate(165%);
}

#promptModal .modal-header {
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  margin: 0;
  padding: 28px 36px 10px 26px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

#promptModal .modal-header::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(11,143,144,.16), transparent);
}

#promptModal .form-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 8px 0 26px;
  padding: 0 16px 6px 0;
  row-gap: 18px;
  column-gap: 14px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 143, 144, 0.54) transparent;
}

#promptModal .form-grid::-webkit-scrollbar {
  width: 9px;
}

#promptModal .form-grid::-webkit-scrollbar-track {
  border-radius: 999px;
  background: transparent;
}

#promptModal .form-grid::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(83,202,198,.82), rgba(96,136,226,.64));
  box-shadow: none;
}

#promptModal .modal-actions {
  position: relative;
  flex: 0 0 auto;
  bottom: auto;
  z-index: 2;
  margin: 10px 20px 20px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 999px;
  background: rgba(255,255,255,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 22px rgba(18, 32, 38, 0.06);
  backdrop-filter: blur(12px) saturate(130%);
}

#promptModal .form-grid input,
#promptModal .form-grid textarea {
  background: rgba(255,255,255,.66);
  border-color: rgba(255,255,255,.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 5px 14px rgba(22, 34, 38, 0.035);
  backdrop-filter: blur(10px) saturate(120%);
}

#promptModal .form-grid input:focus,
#promptModal .form-grid textarea:focus {
  border-color: rgba(70, 200, 195, 0.78);
  box-shadow: 0 0 0 3px rgba(70, 200, 195, 0.12), inset 0 1px 0 rgba(255,255,255,.78);
}

@media (max-width: 720px) {
  #promptModal form {
    max-height: calc(100vh - 18px);
  }

  #promptModal .modal-header {
    padding: 22px 24px 10px 18px;
  }

  #promptModal .form-grid {
    grid-template-columns: 1fr;
    margin-left: 18px;
    margin-right: 6px;
    padding-right: 12px;
  }

  #promptModal .modal-actions {
    margin: 10px 14px 14px;
    border-radius: 22px;
  }
}


/* Prompt editor select polish */
#promptModal .form-grid select {
  min-height: 46px;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  padding: 0 44px 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.76), rgba(255,255,255,.46)),
    rgba(255,255,255,.52);
  color: #253033;
  font-weight: 760;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 5px 14px rgba(22, 34, 38, 0.035);
  backdrop-filter: blur(10px) saturate(120%);
  background-image:
    linear-gradient(45deg, transparent 50%, #536166 50%),
    linear-gradient(135deg, #536166 50%, transparent 50%),
    linear-gradient(145deg, rgba(255,255,255,.76), rgba(255,255,255,.46));
  background-position:
    calc(100% - 24px) 50%,
    calc(100% - 18px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

#promptModal .form-grid select:hover {
  border-color: rgba(102, 214, 210, 0.66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 7px 16px rgba(22, 34, 38, 0.045);
}

#promptModal .form-grid select:focus {
  border-color: rgba(102, 214, 210, 0.9);
  box-shadow:
    0 0 0 3px rgba(102, 214, 210, 0.13),
    inset 0 1px 0 rgba(255,255,255,.82);
}

#promptModal .form-grid select::-ms-expand {
  display: none;
}


/* Editor custom dropdown menu */
#promptModal .editor-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#promptModal .editor-select {
  position: relative;
  width: 100%;
  z-index: 3;
}

#promptModal .editor-select-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 15px 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,255,255,.42)),
    rgba(255,255,255,.5);
  color: #253033;
  font-weight: 760;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 5px 14px rgba(22, 34, 38, 0.035);
  backdrop-filter: blur(10px) saturate(120%);
}

#promptModal .editor-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#promptModal .editor-select-arrow {
  width: 8px;
  height: 8px;
  border-right: 2px solid #536166;
  border-bottom: 2px solid #536166;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
  justify-self: center;
}

#promptModal .editor-select-button[aria-expanded="true"] .editor-select-arrow {
  transform: translateY(2px) rotate(225deg);
}

#promptModal .editor-select-menu {
  position: absolute;
  z-index: 4000;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 5px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.88), rgba(255,255,255,.62)),
    rgba(255,255,255,.72);
  box-shadow: 0 24px 60px rgba(16, 30, 34, .16), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(24px) saturate(155%);
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

#promptModal .editor-select-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#promptModal .editor-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #2d383d;
  text-align: left;
  font-weight: 760;
}

#promptModal .editor-select-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#promptModal .editor-select-option small {
  color: #7a8589;
  font-size: 11px;
  font-weight: 760;
}

#promptModal .editor-select-option:hover,
#promptModal .editor-select-option.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(11,143,144,.82), rgba(102,214,210,.72) 52%, rgba(109,141,247,.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42), 0 10px 20px rgba(11,143,144,.12);
}

#promptModal .editor-select-option:hover small,
#promptModal .editor-select-option.active small {
  color: rgba(255,255,255,.82);
}

#promptModal .form-grid label:has(.editor-select-menu.open) {
  z-index: 20;
}

#promptModal .editor-select.disabled .editor-select-button,
#promptModal .editor-select-button:disabled {
  cursor: not-allowed;
  opacity: 0.66;
  filter: saturate(0.75);
}

#promptModal .editor-select.disabled .editor-select-arrow,
#promptModal .editor-select-button:disabled .editor-select-arrow {
  opacity: 0.45;
}

#promptModal .editor-select-option:disabled,
#promptModal .editor-select-option.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}


/* Horizontal filter rails */
.filter-bar {
  overflow: hidden;
}

.type-tabs,
.tag-rail,
.collection-rail {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 143, 144, 0.42) rgba(255, 255, 255, 0.28);
  padding-right: 46px;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 58px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 58px), transparent 100%);
}

.type-tabs::-webkit-scrollbar,
.tag-rail::-webkit-scrollbar,
.collection-rail::-webkit-scrollbar {
  height: 7px;
  display: block;
}

.type-tabs::-webkit-scrollbar-track,
.tag-rail::-webkit-scrollbar-track,
.collection-rail::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.type-tabs::-webkit-scrollbar-thumb,
.tag-rail::-webkit-scrollbar-thumb,
.collection-rail::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(102, 214, 210, 0.76), rgba(109, 141, 247, 0.58));
}

.cloud-config-field.hidden,
#saveCloudConfigBtn.hidden {
  display: none !important;
}


/* Premium auth modal */
.auth-modal {
  width: min(1040px, calc(100vw - 28px));
  border-radius: 34px;
}

.auth-modal .auth-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.05fr);
  gap: 0;
  min-height: 560px;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(102, 214, 210, 0.24), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(239, 133, 118, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.48));
  backdrop-filter: blur(30px) saturate(170%);
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 18px;
  min-height: 560px;
  padding: 42px;
  overflow: hidden;
  color: #0f1b20;
  background:
    linear-gradient(155deg, rgba(102, 214, 210, 0.92), rgba(109, 141, 247, 0.76) 48%, rgba(239, 133, 118, 0.58)),
    rgba(255, 255, 255, 0.24);
}

.auth-visual-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  min-height: 100%;
  width: 100%;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}

.auth-visual-inner.layout-top { justify-content: flex-start; }
.auth-visual-inner.layout-center { justify-content: center; }
.auth-visual-inner.layout-bottom { justify-content: flex-end; }
.auth-visual-inner.layout-split { justify-content: space-between; }
.auth-visual-inner.layout-split .auth-brand-mark { margin-bottom: auto; }

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.34);
  pointer-events: none;
}

.auth-visual::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -92px;
  top: -74px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.34);
  background: radial-gradient(circle, rgba(255,255,255,0.28), rgba(255,255,255,0.02) 62%, transparent 68%);
  pointer-events: none;
}

.auth-brand-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(255,255,255,0.62);
  border-radius: 24px;
  color: white;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08)),
    rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.42), 0 24px 54px rgba(14, 47, 60, 0.18);
  font-size: 34px;
  font-weight: 950;
}

.auth-visual .eyebrow,
.auth-visual h2,
.auth-visual .auth-lead,
.auth-benefits {
  position: relative;
  z-index: 1;
}

.auth-visual .eyebrow {
  margin: 0;
  color: rgba(255,255,255,0.86);
}

.auth-visual h2 {
  max-width: 360px;
  margin: 0;
  color: white;
  font-family: var(--display-font);
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 14px 34px rgba(12, 38, 48, 0.16);
}

.auth-lead {
  max-width: 360px;
  margin: 0;
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.75;
}

.auth-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-benefits span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,0.38);
  border-radius: 999px;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.14);
  font-size: 12px;
  font-weight: 820;
  backdrop-filter: blur(12px) saturate(150%);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  padding: 40px;
  min-width: 0;
}

.auth-header {
  flex: 0 0 auto;
  margin-bottom: 30px;
}

.auth-header h2 {
  font-size: 32px;
  line-height: 1.12;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.auth-field {
  gap: 9px;
  color: #435257;
  font-size: 13px;
  font-weight: 850;
}

.auth-field input {
  min-height: 54px;
  padding-inline: 18px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.5)),
    rgba(255,255,255,0.56);
}

.auth-modal .cloud-status {
  min-height: 58px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(220, 252, 252, 0.68), rgba(255,255,255,0.52));
}

.auth-actions {
  grid-template-columns: 1fr 1fr auto auto;
  margin-top: auto;
  padding-top: 24px;
  align-items: center;
}

.auth-actions .primary-action {
  min-height: 48px;
}

.auth-actions .ghost {
  min-height: 48px;
  justify-content: center;
  text-align: center;
}

@media (max-width: 820px) {
  .auth-modal .auth-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-visual {
    min-height: 260px;
    padding: 30px;
  }

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

  .auth-panel {
    padding: 28px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }
}


/* Auth modal form polish */
.auth-modal .auth-panel {
  position: relative;
  justify-content: center;
  padding: 52px 52px 48px;
}

.auth-modal .auth-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}

.auth-modal .auth-header h2 {
  margin: 6px 0 10px;
  font-size: clamp(32px, 3vw, 42px);
  letter-spacing: 0;
}

.auth-modal .auth-subtitle {
  max-width: 410px;
  margin: 0;
  color: rgba(42, 54, 58, 0.72);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.75;
}

.auth-modal #closeCloudBtn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: rgba(18, 29, 33, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.48));
  box-shadow: 0 14px 32px rgba(32, 42, 45, 0.12), inset 0 1px 0 rgba(255,255,255,0.9);
  font-size: 22px;
  line-height: 1;
}

.auth-modal #closeCloudBtn:hover {
  transform: translateY(-1px);
  color: #0f1b20;
  box-shadow: 0 18px 40px rgba(32, 42, 45, 0.16), inset 0 1px 0 rgba(255,255,255,0.95);
}

.auth-modal .auth-form-grid {
  gap: 16px;
}

.auth-modal .auth-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  color: rgba(45, 60, 65, 0.78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-modal .auth-field span {
  padding-left: 4px;
}

.auth-modal .auth-field input {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  color: #152329;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.58)),
    rgba(255,255,255,0.62);
  box-shadow:
    0 18px 42px rgba(30, 46, 52, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.92),
    inset 0 -18px 42px rgba(115, 153, 176, 0.08);
  font-size: 14px;
  font-weight: 780;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.auth-modal .auth-field input::placeholder {
  color: rgba(66, 78, 82, 0.48);
  font-weight: 760;
}

.auth-modal .auth-field input:hover {
  border-color: rgba(112, 210, 207, 0.62);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.96), rgba(255,255,255,0.66)),
    rgba(255,255,255,0.68);
}

.auth-modal .auth-field input:focus {
  border-color: rgba(26, 181, 181, 0.72);
  box-shadow:
    0 22px 48px rgba(30, 46, 52, 0.1),
    0 0 0 4px rgba(88, 211, 207, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.95);
  transform: translateY(-1px);
}

.auth-modal .auth-status {
  margin: 18px 0 0;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 20px;
  color: rgba(49, 64, 69, 0.72);
  background:
    linear-gradient(135deg, rgba(224, 252, 252, 0.7), rgba(255,255,255,0.5));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 16px 34px rgba(34, 48, 54, 0.06);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.55;
}

.auth-modal .auth-actions {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  margin-top: 24px;
  padding-top: 0;
  align-items: stretch;
}

.auth-modal .auth-actions .hidden,
.auth-modal .auth-actions .hidden-field,
.auth-modal #saveCloudConfigBtn {
  display: none !important;
}

.auth-modal .auth-actions button {
  min-height: 52px;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 20px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.auth-modal .auth-actions .primary {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(10, 153, 157, 0.98), rgba(101, 136, 245, 0.92));
  box-shadow: 0 22px 46px rgba(34, 133, 177, 0.24), inset 0 1px 0 rgba(255,255,255,0.28);
}

.auth-modal .auth-actions .secondary {
  color: rgba(28, 41, 46, 0.78);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.8), rgba(255,255,255,0.42));
  box-shadow: 0 16px 34px rgba(32, 42, 45, 0.08), inset 0 1px 0 rgba(255,255,255,0.88);
}

.auth-modal .auth-actions button:hover {
  transform: translateY(-2px);
}

.auth-modal .auth-actions .primary:hover {
  box-shadow: 0 26px 54px rgba(34, 133, 177, 0.28), inset 0 1px 0 rgba(255,255,255,0.36);
}

.auth-modal .auth-actions .secondary:hover {
  border-color: rgba(111, 211, 208, 0.56);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,255,255,0.54));
  box-shadow: 0 20px 42px rgba(32, 42, 45, 0.1), inset 0 1px 0 rgba(255,255,255,0.94);
}

@media (max-width: 820px) {
  .auth-modal .auth-panel {
    padding: 30px 24px 26px;
  }

  .auth-modal .auth-actions {
    grid-template-columns: 1fr;
  }
}


.auth-modal .auth-actions button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.auth-modal .auth-actions button.loading {
  position: relative;
  color: transparent;
}

.auth-modal .auth-actions button.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  inset: 0;
  margin: auto;
  border: 2px solid rgba(255,255,255,0.55);
  border-top-color: rgba(255,255,255,0.95);
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}

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


.auth-modal[data-auth-mode="signup"] .auth-actions {
  grid-template-columns: 1.1fr 1fr;
}

.auth-modal[data-auth-mode="signup"] .auth-status {
  background:
    linear-gradient(135deg, rgba(237, 249, 255, 0.74), rgba(255,255,255,0.5));
}

.auth-confirm-field.hidden {
  display: none !important;
}

.auth-modal .auth-actions button.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .auth-modal[data-auth-mode="signup"] .auth-actions {
    grid-template-columns: 1fr;
  }
}


/* Social profile center */
.social-profile-modal {
  width: min(1120px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(248,255,253,0.96), rgba(255,248,247,0.92));
  box-shadow: 0 36px 110px rgba(35, 48, 64, 0.26);
  overflow: hidden;
}

.social-profile-modal::backdrop {
  background: rgba(14, 22, 28, 0.54);
  backdrop-filter: blur(16px);
}

.social-profile-shell {
  max-height: min(860px, calc(100vh - 34px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px;
  background: transparent;
  backdrop-filter: none;
  scrollbar-gutter: stable;
}

.social-profile-shell::-webkit-scrollbar { width: 10px; }
.social-profile-shell::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(82,199,194,0.88), rgba(113,143,236,0.88));
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.7);
}

.profile-cover-card {
  position: relative;
  isolation: isolate;
  min-height: 290px;
  padding: 26px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.78);
  background:
    radial-gradient(circle at 15% 18%, rgba(89,211,207,0.58), transparent 34%),
    radial-gradient(circle at 78% 8%, rgba(123,145,240,0.48), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,0.62), rgba(255,255,255,0.18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 24px 60px rgba(61, 82, 96, 0.16);
}

.profile-cover-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.35), rgba(255,255,255,0.06) 48%, rgba(255,255,255,0.24));
  pointer-events: none;
  z-index: -1;
}

.profile-cover-glow {
  position: absolute;
  right: 7%;
  top: 16%;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  opacity: 0.56;
}

.profile-close-button {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 4;
  background: rgba(255,255,255,0.78);
}

.profile-cover-main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  min-height: 170px;
}

.profile-cover-avatar {
  width: 104px;
  height: 104px;
  border-radius: 32px;
  font-size: 38px;
  box-shadow: 0 24px 52px rgba(42, 83, 135, 0.26), inset 0 1px 0 rgba(255,255,255,0.82);
}

.profile-cover-copy h2 {
  margin: 4px 0 8px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
}

.profile-cover-copy strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
}

.profile-cover-copy span,
.profile-cover-copy p {
  display: block;
  max-width: 660px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.profile-cover-copy p { margin-top: 10px; }

.profile-cover-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-right: 48px;
}

.profile-cover-actions .soft-button,
.profile-cover-actions .primary-button {
  min-width: 116px;
  height: 44px;
  border-radius: 999px;
  font-weight: 800;
}

.social-profile-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.social-profile-stats span {
  min-height: 88px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(255,255,255,0.76);
  box-shadow: 0 18px 42px rgba(37, 56, 72, 0.12);
}

.social-profile-stats strong { font-size: 32px; }

.social-profile-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 16px 0 12px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(255,255,255,0.74);
  backdrop-filter: blur(18px);
  overflow-x: auto;
}

.social-profile-tabs button {
  min-width: 96px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.social-profile-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #39c5bd, #7195f4);
  box-shadow: 0 14px 28px rgba(67, 143, 202, 0.28);
}

.profile-panel {
  padding: 12px 4px 6px;
}

.profile-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.88fr);
  gap: 16px;
}

.profile-home-feature {
  grid-row: span 2;
}

.profile-home-section {
  padding: 18px;
  border-radius: 26px;
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: 0 22px 56px rgba(46, 63, 78, 0.11);
}

.profile-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 900;
  color: var(--ink);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--teal-strong);
  font-weight: 800;
  cursor: pointer;
}

.profile-card-list.compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.social-profile-modal .profile-card-list:not(.compact) {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.social-profile-modal .profile-mini-card {
  min-height: 118px;
  align-items: stretch;
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: 0 14px 32px rgba(31, 49, 64, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.social-profile-modal .profile-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(31, 49, 64, 0.15);
}

.social-profile-modal .profile-mini-media {
  width: 112px;
  min-height: 102px;
  border-radius: 18px;
  overflow: hidden;
}

.social-profile-modal .profile-mini-body {
  padding: 8px 2px;
  justify-content: center;
}

.social-profile-modal .profile-empty-card {
  border-radius: 22px;
  background: rgba(255,255,255,0.62);
  border: 1px dashed rgba(49, 176, 170, 0.34);
}

.profile-settings-grid {
  padding: 20px;
  border-radius: 26px;
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(255,255,255,0.72);
}

.profile-settings-actions {
  position: sticky;
  bottom: 0;
  margin: 0 -4px -6px;
  padding: 16px 4px 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(248,255,253,0.96) 38%);
}

@media (max-width: 820px) {
  .social-profile-modal { width: calc(100vw - 18px); border-radius: 24px; }
  .social-profile-shell { padding: 12px; }
  .profile-cover-card { min-height: auto; padding: 20px; border-radius: 22px; }
  .profile-cover-main { grid-template-columns: 76px 1fr; align-items: start; }
  .profile-cover-actions { grid-column: 1 / -1; padding-right: 0; flex-wrap: wrap; }
  .profile-cover-avatar { width: 76px; height: 76px; border-radius: 24px; font-size: 28px; }
  .profile-cover-copy h2 { font-size: clamp(30px, 10vw, 46px); }
  .social-profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-home-layout { grid-template-columns: 1fr; }
  .profile-home-feature { grid-row: auto; }
}


/* Profile center polish */
.social-profile-modal button {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  outline: none;
}

.social-profile-modal button:focus-visible {
  box-shadow: 0 0 0 3px rgba(72, 202, 196, 0.2), 0 0 0 1px rgba(52, 165, 170, 0.36) inset;
}

.profile-cover-actions .soft-button,
.profile-cover-actions .primary-button,
.profile-settings-actions .soft-button,
.profile-settings-actions .primary-button,
.social-profile-modal .profile-section-heading .text-button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34));
  color: #182427;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 14px 34px rgba(46, 63, 78, 0.12);
  backdrop-filter: blur(18px) saturate(160%);
  cursor: pointer;
}

.profile-cover-actions .primary-button,
.profile-settings-actions .primary-button {
  color: #fff;
  border-color: rgba(255,255,255,0.48);
  background: linear-gradient(135deg, rgba(46, 195, 189, 0.96), rgba(108, 145, 241, 0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.42), 0 18px 40px rgba(58, 134, 204, 0.24);
}

.profile-cover-actions .soft-button::before,
.profile-cover-actions .primary-button::before,
.profile-settings-actions .soft-button::before,
.profile-settings-actions .primary-button::before,
.social-profile-modal .profile-section-heading .text-button::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 52%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0));
  pointer-events: none;
}

.profile-cover-actions .soft-button:hover,
.profile-cover-actions .primary-button:hover,
.profile-settings-actions .soft-button:hover,
.profile-settings-actions .primary-button:hover,
.social-profile-modal .profile-section-heading .text-button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 20px 44px rgba(46, 63, 78, 0.16);
}

.profile-close-button {
  border: 1px solid rgba(255,255,255,0.78);
  color: #1d2a2d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.84), 0 12px 26px rgba(45, 57, 66, 0.12);
}

.social-profile-modal .profile-section-heading .text-button {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #187f80;
  font-weight: 850;
}

.social-profile-modal .profile-mini-card {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  min-height: 124px;
  border: 1px solid rgba(255,255,255,0.74);
  background: linear-gradient(145deg, rgba(255,255,255,0.82), rgba(255,255,255,0.56));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 18px 38px rgba(31,49,64,0.1);
}

.social-profile-modal .profile-card-list.compact .profile-mini-card {
  grid-template-columns: 104px minmax(0, 1fr);
}

.social-profile-modal .profile-mini-media {
  width: 112px;
  height: 104px;
  min-height: 104px;
  align-self: stretch;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
}

.social-profile-modal .profile-card-list.compact .profile-mini-media {
  width: 104px;
}

.social-profile-modal .profile-mini-body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 7px;
  min-width: 0;
  padding: 2px 4px 2px 0;
}

.profile-mini-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.profile-mini-title {
  min-width: 0;
  color: #0f1719;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-mini-rating {
  flex: 0 0 auto;
  max-width: 96px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #a06a08;
  background: rgba(255, 247, 224, 0.86);
  border: 1px solid rgba(245, 206, 121, 0.45);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-mini-meta,
.profile-mini-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.profile-mini-meta small,
.profile-mini-chips small {
  max-width: 120px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(229, 249, 247, 0.78);
  color: #087c7a;
  border: 1px solid rgba(78, 200, 195, 0.18);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-mini-chips small {
  background: rgba(255,255,255,0.64);
  color: #536166;
  border-color: rgba(33, 48, 54, 0.08);
}

.profile-mini-excerpt {
  min-width: 0;
  color: #627176;
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 620px) {
  .social-profile-modal .profile-mini-card,
  .social-profile-modal .profile-card-list.compact .profile-mini-card {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
  }
  .social-profile-modal .profile-mini-media,
  .social-profile-modal .profile-card-list.compact .profile-mini-media {
    width: 86px;
    height: 92px;
    min-height: 92px;
  }
  .profile-mini-header {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .profile-mini-rating {
    max-width: 100%;
    justify-self: start;
  }
}


/* Asset uploader */
.asset-uploader {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
  grid-template-areas:
    "copy button"
    "status status"
    "preview preview";
  grid-auto-rows: auto;
  gap: 14px 16px;
  align-items: center;
  padding: 18px;
  min-height: 128px;
  height: auto;
  overflow: hidden;
  align-self: start;
  margin: 2px 0 4px;
  border: 1px solid rgba(255,255,255,0.76);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.74), rgba(255,255,255,0.46)),
    radial-gradient(circle at 12% 12%, rgba(84, 205, 199, 0.18), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 7px 18px rgba(33, 50, 62, 0.045);
  cursor: pointer;
  backdrop-filter: blur(12px) saturate(128%);
}

.asset-uploader.dragging {
  border-color: rgba(58, 197, 190, 0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 24px rgba(52, 151, 177, 0.12);
  transform: translateY(-1px);
}

.asset-uploader input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.asset-uploader-copy {
  grid-area: copy;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.asset-uploader-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.asset-uploader-copy span,
#assetUploadStatus {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

#assetUploadStatus {
  grid-area: status;
  grid-column: 1 / -1;
  max-width: 100%;
  max-height: 88px;
  margin: 0;
  padding: 9px 12px;
  overflow: auto;
  border-radius: 16px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.68);
  word-break: break-word;
  white-space: normal;
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 143, 144, 0.48) transparent;
}

#assetUploadStatus::-webkit-scrollbar {
  width: 7px;
}

#assetUploadStatus::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(102,214,210,.72), rgba(109,141,247,.58));
}

#assetUploadStatus.error {
  color: #9d341f;
  background: rgba(255, 238, 232, 0.78);
  border-color: rgba(234, 115, 83, 0.28);
}

.asset-upload-button {
  grid-area: button;
  justify-self: end;
  align-self: center;
  position: relative;
  overflow: hidden;
  min-height: 42px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(54, 196, 189, 0.94), rgba(105, 145, 240, 0.9));
  color: #fff;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.38), 0 8px 18px rgba(55, 134, 202, 0.16);
  cursor: pointer;
}

.asset-upload-button::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 52%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.54), rgba(255,255,255,0));
}

.asset-preview-list {
  grid-area: preview;
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding-top: 4px;
  overflow: hidden;
}

.asset-uploader.has-preview {
  min-height: 192px;
}

.asset-preview-list:empty {
  display: none;
}

.asset-preview-list:not(:empty) {
  min-height: 72px;
  margin-top: 4px;
}

.asset-preview-chip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: none;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.64);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: 0 10px 24px rgba(31,49,64,0.08);
}

.asset-preview-chip img,
.asset-preview-chip video {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.reference-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

.reference-grid .compare-item {
  min-height: 112px;
}

.asset-preview-chip span {
  min-width: 0;
  color: #536166;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .asset-uploader {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "button"
      "status"
      "preview";
  }
  .asset-upload-button { justify-self: start; }
}
