:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --ink: #1d1d1f;
  --ink-secondary: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  --radius-card: 20px;
  --radius-ctl: 14px;
  --blur: 20px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --page-pad: clamp(1.25rem, 5vw, 3.25rem);
  --header-pad-y: 0.65rem;
  --masonry-gap: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(220, 220, 225, 0.7), transparent 55%),
    radial-gradient(600px 400px at 50% 100%, rgba(230, 230, 235, 0.5), transparent 50%);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video,
audio {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
  box-sizing: border-box;
}

.main.container,
.container.main {
  width: 100%;
  max-width: none;
}

.glass {
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(var(--blur));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
  border-radius: var(--radius-card);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: rgba(255, 255, 255, 0.92);
  }
}

.site-header {
  position: sticky;
  top: 0.5rem;
  z-index: 50;
  margin: 0.5rem var(--page-pad) 0;
  width: auto;
  max-width: none;
  border-radius: 999px;
  padding: var(--header-pad-y) clamp(1.1rem, 2.5vw, 1.75rem);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  background: var(--glass-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), inset 0 1px 0 var(--glass-highlight);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
  max-width: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  flex-shrink: 0;
}

.brand-text {
  line-height: 1;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0.2rem 0.25rem 0.2rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--hairline);
  box-sizing: border-box;
}

.header-search input[type="search"] {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0.4rem 0.25rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  font-size: 0.9rem;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header-search input[type="search"]:focus {
  outline: none;
  box-shadow: none;
  background: transparent;
}

.header-search .btn {
  flex-shrink: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.92rem;
  justify-content: flex-end;
  align-items: center;
}

.nav a {
  padding: 0.25rem 0.15rem;
  white-space: nowrap;
}

.muted {
  color: var(--ink-secondary);
}

.link {
  color: var(--ink-secondary);
  text-decoration: none;
}

.link:hover {
  color: var(--ink);
}

.main {
  padding: 2%;
  width: 100%;
}

.hero {
  padding: 0.5rem 0 0.85rem;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 1rem;
  border-radius: 999px;
}

/* Title + filters: one row, space-between, vertically centered */
.explore-toolbar-wrap {
  margin-top: 0.35rem;
}

.explore-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  width: 100%;
  margin: 0 0 1rem;
  min-height: 2.5rem;
}

.explore-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explore-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 0 auto;
}

/* Custom select — hide system UI */
.ui-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-weight: 500;
  gap: 0;
}

.ui-select select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: auto;
  min-width: 7.5rem;
  max-width: 12rem;
  height: 2.35rem;
  margin: 0;
  padding: 0 2.1rem 0 0.95rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.78);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231d1d1f' d='M1.4 1.4L6 6l4.6-4.6L12 2.8 6 8.8 0 2.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 10px 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.ui-select select:hover {
  background-color: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.12);
}

.ui-select select:focus {
  border-color: rgba(29, 29, 31, 0.28);
  background-color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 0 0 3px rgba(29, 29, 31, 0.08);
}

.ui-select select::-ms-expand {
  display: none;
}

.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;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  margin: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--hairline);
  font-size: 0.85rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.more-tasks {
  position: relative;
}

.more-tasks summary {
  list-style: none;
  cursor: pointer;
}

.more-tasks summary::-webkit-details-marker {
  display: none;
}

.more-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 160px;
  padding: 0.6rem;
  display: grid;
  gap: 0.35rem;
  z-index: 20;
}

.more-panel a {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}

.more-panel a:hover {
  background: rgba(0, 0, 0, 0.04);
}

.section-block {
  margin-top: 2rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.collection-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  width: 100%;
}

.collection-card {
  display: block;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.collection-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.collection-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.collection-card p {
  margin: 0;
  font-size: 0.9rem;
}

.collection-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.collection-pill {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-weight: 500;
}

.card-grid {
  column-count: 5;
  column-gap: var(--masonry-gap);
  width: 100%;
}

@media (max-width: 1400px) {
  .card-grid {
    column-count: 4;
  }
}

@media (max-width: 1100px) {
  .card-grid {
    column-count: 3;
  }
}

@media (max-width: 720px) {
  .card-grid {
    column-count: 2;
  }
}

@media (max-width: 420px) {
  .card-grid {
    column-count: 1;
  }
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand nav"
      "search search";
  }

  .brand { grid-area: brand; }
  .header-search {
    grid-area: search;
    max-width: none;
    margin: 0;
  }
  .nav { grid-area: nav; }
}

@media (max-width: 560px) {
  .site-header {
    border-radius: 18px;
    top: 0.4rem;
    margin-top: 0.4rem;
  }

  .header-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "search"
      "nav";
  }

  .nav {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
  }

  .brand {
    font-size: 1.1rem;
  }
}

/* Midjourney Explore: dense image wall */
a.prompt-card {
  text-decoration: none;
  color: inherit;
}

.prompt-card {
  display: block;
  width: 100%;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 var(--masonry-gap);
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #e8e8ed;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prompt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.prompt-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.card-media {
  position: relative;
  overflow: hidden;
  line-height: 0;
}

.card-media img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}

.cover-placeholder {
  width: 100%;
  aspect-ratio: var(--ph-ratio, 3 / 4);
  background: linear-gradient(145deg, #ececef 0%, #f7f7f8 45%, #e2e2e6 100%);
}

.card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 2.2rem 0.7rem 0.65rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  line-height: 1.3;
}

.card-caption h3 {
  margin: 0;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .prompt-card:hover .card-caption {
    opacity: 1;
  }
}

@media (hover: none) {
  .prompt-card:focus-within .card-caption {
    opacity: 1;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-light {
  background: #fff;
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 999px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-secondary);
  font-size: 0.78rem;
  line-height: 1.3;
}

.pagination {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.pagination a {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--hairline);
}

.pagination a.active {
  background: var(--ink);
  color: #fff;
}

.empty,
.panel {
  padding: 1.25rem 1.4rem;
}

.toast {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.toast.success {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--hairline);
}

.toast.error {
  background: rgba(255, 230, 230, 0.9);
  border: 1px solid rgba(180, 40, 40, 0.2);
}

.detail {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.detail-hero {
  overflow: hidden;
  padding: 0;
}

.detail-cover {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  background: #ececef;
}

.detail-head {
  padding: 1.15rem 1.25rem 1.35rem;
}

.detail-head h1 {
  margin: 0.55rem 0 0.25rem;
  letter-spacing: -0.03em;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.25;
}

.detail-head .badges,
.detail-head .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.detail-head .meta {
  margin: 0.65rem 0 0.75rem;
}

.detail-hero-text {
  padding: 1.4rem 1.5rem 1.6rem;
}

.detail-hero-text h1 {
  margin: 0.5rem 0 0.25rem;
  letter-spacing: -0.03em;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

/* Image / video carousel */
.gallery {
  padding: 0.75rem;
  overflow: hidden;
}

.gallery-stage {
  position: relative;
  background: #ececef;
  border-radius: 14px;
  overflow: hidden;
  min-height: 200px;
}

.gallery-slide {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.gallery-slide.is-active {
  display: flex;
}

.gallery-slide img,
.gallery-slide video {
  width: 100%;
  height: auto;
  max-height: min(78vh, 900px);
  object-fit: contain;
  display: block;
  background: #ececef;
}

.gallery-slide audio {
  width: 90%;
  margin: 2rem auto;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 2;
}

.gallery-prev { left: 0.65rem; }
.gallery-next { right: 0.65rem; }

.gallery-nav:hover {
  background: #fff;
}

.gallery-thumbs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.75rem 0.15rem 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.gallery-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #e4e4e8;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.gallery-thumb.is-active {
  border-color: var(--ink);
}

.gallery-count {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.8rem;
}

.detail-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.pager-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}

a.pager-item:hover {
  background: #fff;
  transform: translateY(-1px);
}

.pager-item.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pager-label {
  font-size: 0.78rem;
}

.pager-item strong {
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pager-next {
  text-align: right;
  align-items: flex-end;
}

@media (max-width: 560px) {
  .detail-pager {
    grid-template-columns: 1fr;
  }

  .pager-next {
    text-align: left;
    align-items: flex-start;
  }
}

.title-en {
  margin: 0 0 0.5rem;
}

.lead {
  margin: 0.5rem 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.88rem;
  margin: 0.75rem 0;
}

.badges {
  position: relative;
}

.badges .badge {
  position: static;
  display: inline-block;
  margin-right: 0.35rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.liquid-dark {
  background: rgba(29, 29, 31, 0.88);
  color: #f5f5f7;
  border-radius: var(--radius-card);
  padding: 1.25rem 1.4rem 1.5rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.prompt-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.prompt-tabs .tab {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

.prompt-tabs .tab.active {
  background: #fff;
  color: var(--ink);
}

.prompt-pane {
  display: none;
}

.prompt-pane.active {
  display: block;
}

.prompt-text,
.sub-prompt pre,
.params pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.sub-prompt,
.params {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sub-prompt h3,
.params h3,
.panel h2 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.media-grid img,
.media-grid video {
  border-radius: 14px;
  width: 100%;
  background: #eee;
}

.prose p {
  margin: 0.6rem 0;
}

.site-footer {
  padding: 2rem 0 3rem;
  text-align: center;
  font-size: 0.85rem;
}

.login-wrap {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.login-card {
  width: min(400px, 100%);
  padding: 1.6rem;
  display: grid;
  gap: 0.85rem;
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}

label.ui-select {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: inherit;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-ctl);
  padding: 0.75rem 0.95rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.03);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(29, 29, 31, 0.28);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 0 0 3px rgba(29, 29, 31, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #a1a1a6;
}

select {
  padding-right: 2.4rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #1d1d1f 50%),
    linear-gradient(135deg, #1d1d1f 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) calc(50% - 0.15rem),
    calc(100% - 0.85rem) calc(50% - 0.15rem);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* Homepage toolbar selects — override form defaults */
.ui-select select,
label.ui-select select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: auto;
  min-width: 7.5rem;
  max-width: 12rem;
  height: 2.35rem;
  padding: 0 2.1rem 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background-color: rgba(255, 255, 255, 0.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231d1d1f' d='M1.4 1.4L6 6l4.6-4.6L12 2.8 6 8.8 0 2.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 10px 7px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 2.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.ui-select select:focus,
label.ui-select select:focus {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231d1d1f' d='M1.4 1.4L6 6l4.6-4.6L12 2.8 6 8.8 0 2.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 10px 7px;
}

select option {
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
  line-height: 1.5;
}

/* File input — glass pill */
input[type="file"] {
  width: 100%;
  padding: 0.55rem;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-ctl);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-secondary);
  font: inherit;
  cursor: pointer;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="file"]:hover {
  border-color: rgba(29, 29, 31, 0.25);
  background: rgba(255, 255, 255, 0.8);
}

input[type="file"]::file-selector-button {
  margin-right: 0.85rem;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
  margin-right: 0.85rem;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Custom checkbox */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  vertical-align: middle;
  position: relative;
}

input[type="checkbox"]:checked {
  background: var(--ink);
  border-color: var(--ink);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.12rem;
  width: 0.28rem;
  height: 0.5rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.1);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 400;
  cursor: pointer;
}

.search-bar input {
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.7rem 1rem;
  font: inherit;
  outline: none;
  backdrop-filter: none !important;
}

.search-bar input:focus {
  box-shadow: none !important;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  input:not([type]),
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  select,
  textarea {
    background: #fff;
  }
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-head h1 {
  margin: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.bulk-bar select {
  width: auto;
  min-width: 8rem;
}

.inline-edit,
.inline-edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.inline-edit input,
.inline-edit-row input {
  width: auto;
  min-width: 8rem;
  flex: 1;
}

.admin-filters input,
.admin-filters select {
  width: auto;
  min-width: 140px;
  flex: 1 1 140px;
  margin: 0;
}

.admin-filters .btn {
  flex: 0 0 auto;
  width: auto;
}

.admin-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 1rem 0.75rem;
  width: 100%;
}

.admin-table table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.92rem;
}

.admin-table col.c-title { width: 36%; }
.admin-table col.c-task { width: 14%; }
.admin-table col.c-status { width: 12%; }
.admin-table col.c-feat { width: 8%; }
.admin-table col.c-actions { width: 30%; }

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

.admin-table th {
  font-weight: 600;
  color: var(--ink-secondary);
  font-size: 0.82rem;
  white-space: nowrap;
}

.admin-table td.cell-title {
  overflow: hidden;
}

.admin-table td.cell-title a {
  font-weight: 600;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.admin-table td.cell-title .muted {
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table td.cell-task,
.admin-table td.cell-status,
.admin-table td.cell-feat {
  white-space: nowrap;
}

/* Keep td as table-cell — flex on td breaks row height / borders */
.admin-table td.row-actions {
  display: table-cell;
  overflow: visible;
}

.row-actions-inner {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
  vertical-align: middle;
}

.row-actions-inner form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 0;
}

.row-actions-inner .btn {
  width: auto;
}

.link-danger {
  background: none;
  border: 0;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.form-grid {
  display: grid;
  gap: 1rem;
  width: 100%;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.tag-fieldset {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.35);
}

.thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}

.media-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.media-tile {
  margin: 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #ececef;
  aspect-ratio: 1;
}

.media-tile img,
.media-tile-file {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-tile-file {
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.media-tile figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 1.4rem 0.55rem 0.4rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.2;
}

.media-tile .link-danger {
  color: #ffd0d0;
  font-size: 0.75rem;
}

.media-uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  margin-bottom: 0.55rem;
}

@media (max-width: 700px) {
  .media-uploads {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  margin-top: 1rem;
}

.copy-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 300;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.upload-busy {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.upload-busy-card {
  min-width: 220px;
  padding: 1.35rem 1.5rem 1.15rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.upload-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--ink);
  animation: upload-spin 0.7s linear infinite;
}

@keyframes upload-spin {
  to { transform: rotate(360deg); }
}

.upload-busy-text {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.upload-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.upload-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: inherit;
  transition: width 0.15s ease;
}

.upload-pct {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
}

.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit-form {
  width: 100%;
  max-width: none;
  margin: 0;
  position: relative;
  display: grid;
  gap: 1rem;
}

.bilingual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

/* —— Submit page layout —— */
.submit-page {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

.admin-edit {
  max-width: 1080px;
}

.admin-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tag-new {
  flex: 1 1 100%;
  min-width: 220px;
  margin-top: 0.35rem;
}

.check-line {
  justify-content: center;
}

.media-current {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.submit-hero {
  margin: 0 0 1.25rem;
}

.submit-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: -0.03em;
}

.submit-hero p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
}

.submit-card {
  padding: 1.15rem 1.25rem 1.35rem;
  border-radius: var(--radius-card);
}

.submit-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.submit-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.submit-card-head .muted {
  margin: 0;
  font-size: 0.82rem;
}

.submit-grid {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .submit-grid {
    grid-template-columns: 1fr 1fr;
  }

  .submit-grid .span-2 {
    grid-column: 1 / -1;
  }
}

.submit-grid .req {
  color: #b42318;
  margin-left: 0.15rem;
}

.submit-grid .hint {
  margin-left: 0.4rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-secondary);
}

.submit-bilingual {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .submit-bilingual {
    grid-template-columns: 1fr 1fr;
  }
}

.submit-card .tag-fieldset {
  margin-top: 1rem;
}

.submit-more {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.4);
  padding: 0;
}

.submit-more summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.92rem;
  user-select: none;
}

.submit-more summary::-webkit-details-marker {
  display: none;
}

.submit-more summary::after {
  content: "+";
  float: right;
  color: var(--ink-secondary);
  font-weight: 500;
}

.submit-more[open] summary::after {
  content: "−";
}

.submit-more-body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-top: 1px solid var(--hairline);
}

.submit-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  padding: 0.35rem 0.15rem 0.5rem;
}

.submit-footer .muted {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.85rem;
}

.submit-footer .btn {
  flex: 0 0 auto;
  min-width: 8.5rem;
}

@media (max-width: 700px) {
  .bilingual-grid {
    grid-template-columns: 1fr;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .admin-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-actions {
    width: 100%;
  }

  .admin-filters {
    flex-direction: column;
  }

  .admin-filters input,
  .admin-filters select,
  .admin-filters .btn {
    width: 100%;
    min-width: 0;
  }

  .row-actions {
    /* keep table-cell layout */
  }

  .row-actions-inner {
    flex-wrap: wrap;
  }

  .search-bar {
    flex-direction: column;
    border-radius: 18px;
  }

  .search-bar .btn {
    width: 100%;
  }

  .login-card {
    width: 100%;
  }

  .detail-hero-text {
    padding: 1rem 1.1rem 1.25rem;
  }

  .prompt-actions {
    flex-direction: column;
  }

  .prompt-actions .btn {
    width: 100%;
  }

  .liquid-dark {
    padding: 1rem 1.05rem 1.25rem;
  }

  .chips {
    justify-content: flex-start;
  }

  .explore-toolbar {
    flex-wrap: wrap;
    row-gap: 0.65rem;
  }

  .explore-filters {
    margin-left: auto;
  }

  .ui-select select {
    max-width: 10.5rem;
  }
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.status-pill.pending {
  background: rgba(29, 29, 31, 0.08);
  border: 1px solid var(--hairline);
}

/* —— Midjourney-style right detail drawer —— */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

body.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.prompt-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 210;
  width: min(520px, 100vw);
  background: #f7f7f8;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

body.drawer-open .prompt-drawer {
  transform: translateX(0);
}

body.drawer-open {
  overflow: hidden;
}

.drawer-layout {
  display: flex;
  height: 100%;
  min-height: 0;
}

.drawer-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.15rem 2rem;
  -webkit-overflow-scrolling: touch;
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(#f7f7f8 70%, transparent);
  padding-bottom: 0.35rem;
}

.drawer-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.drawer-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.drawer-full {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  text-decoration: none;
}

.drawer-full:hover {
  color: var(--ink);
}

.drawer-hero {
  margin: 0 0 1rem;
  border-radius: 10px;
  overflow: hidden;
  background: #e8e8ed;
  line-height: 0;
}

.drawer-hero img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 280px;
  object-fit: cover;
}

.drawer-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
}

.drawer-task {
  font-weight: 600;
  color: var(--ink);
}

.drawer-title {
  margin: 0.15rem 0 0.4rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.drawer-summary {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.drawer-prompt-block {
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--hairline);
}

.drawer-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.drawer-prompt-head strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.drawer-prompt-head .btn-ghost {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.drawer-prompt-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
  max-height: 220px;
  overflow-y: auto;
  cursor: pointer;
}

.drawer-prompt-text:hover {
  background: rgba(0, 0, 0, 0.02);
}

.drawer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.25rem 0 0.75rem;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.drawer-rail {
  width: 72px;
  flex-shrink: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.75rem 0.55rem;
  border-left: 1px solid var(--hairline);
  background: #f0f0f2;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  -webkit-overflow-scrolling: touch;
}

.rail-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #ddd;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

.rail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rail-thumb.empty {
  background: linear-gradient(145deg, #e4e4e8, #f2f2f4);
}

.rail-thumb:hover {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .prompt-drawer {
    width: 100vw;
  }

  .drawer-rail {
    width: 64px;
    padding: 0.65rem 0.4rem;
  }

  .rail-thumb {
    width: 48px;
    height: 48px;
  }

  .drawer-main {
    padding: 0.85rem 0.9rem 1.5rem;
  }

  .drawer-hero img {
    max-height: 200px;
  }
}
