/* ─────────────────────────────────────────────────────────────────────────────
   Omn Marketplace — light, breezy.
   ─────────────────────────────────────────────────────────────────────────────
   Design rules (deliberate, not decoration):
   • LIGHT IS THE POINT. A marketplace whose job is to make images look good must not sit
     on a dark chrome. The page is near-white; the artwork supplies the colour.
   • No webfont request. The display face is a system serif stack (Iowan/Georgia/Charter),
     which reads editorial and costs zero network round-trips — the same lesson as
     server-rendering /go/: the fastest asset is the one you do not fetch.
   • Whitespace over borders. Hairlines only where a row genuinely needs separating.

   ⚠️ `.tile` uses a fixed aspect ratio so a grid of mixed photos/videos/notes does not
   reflow as images arrive — layout shift on a gallery is the single most visible defect.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #fbfaf8;
  --bg-tint: #f3f0ea;
  --surface: #ffffff;
  --ink: #1a1917;
  --ink-soft: #4a4640;
  --muted: #6f6a62;
  --line: #e9e4dc;
  --line-soft: #f2eee8;
  --accent: #1f7a8c;
  --accent-2: #d9704a;
  --shadow: 0 1px 2px rgba(28, 25, 20, .04), 0 8px 24px -12px rgba(28, 25, 20, .12);
  --shadow-lg: 0 2px 4px rgba(28, 25, 20, .05), 0 20px 48px -20px rgba(28, 25, 20, .20);
  --radius: 14px;
  --radius-lg: 22px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── header ───────────────────────────────────────────────────────────────── */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 250, 248, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 66px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.wordmark b {
  font-weight: 600;
}

.wordmark span {
  color: var(--muted);
  font-style: italic;
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.nav a {
  padding: 6px 0;
  border-bottom: 1.5px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  border-color: var(--ink);
  color: var(--ink);
}

.nav a.cta {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav a.cta:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }
}

/* ── hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 76px 0 44px;
  background:
    radial-gradient(1100px 340px at 12% -10%, #eef6f7 0%, rgba(238, 246, 247, 0) 62%),
    radial-gradient(900px 300px at 88% -20%, #fdf1ea 0%, rgba(253, 241, 234, 0) 60%);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  max-width: 20ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  margin: 0 0 30px;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: 17.5px;
}

.search {
  display: flex;
  gap: 10px;
  max-width: 560px;
}

.search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15.5px;
  padding: 13px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.search button {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 13px 24px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

.search button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── filter bar ───────────────────────────────────────────────────────────── */
.filters {
  position: sticky;
  top: 66px;
  z-index: 30;
  background: rgba(251, 250, 248, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.filters .wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 13px;
  padding-bottom: 13px;
  flex-wrap: wrap;
}

.chip {
  font: inherit;
  font-size: 14px;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: background .15s, border-color .15s, color .15s;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip .n {
  opacity: .55;
  font-size: 12.5px;
  margin-left: 6px;
}

.spacer {
  flex: 1;
}

.count {
  font-size: 13.5px;
  color: var(--muted);
}

/* ── sections ─────────────────────────────────────────────────────────────── */
section {
  padding: 46px 0;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
}

.sec-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: -.01em;
  margin: 0;
}

.sec-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* ── featured rail ────────────────────────────────────────────────────────── */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(255px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.rail>* {
  scroll-snap-align: start;
}

/* ── grid ─────────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 22px 20px;
}

/* ── card ─────────────────────────────────────────────────────────────────── */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #ddd6cb;
}

.tile {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-tint);
  overflow: hidden;
}

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

/* A note has no image at all, so it gets a text tile rather than a broken <img>. */
.tile.text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  text-align: center;
  background: linear-gradient(145deg, #f7f4ee, #efeae2);
}

.tile.text span {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile.text.audio {
  background: linear-gradient(145deg, #eef4f6, #e3edef);
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink-soft);
  border: 1px solid rgba(0, 0, 0, .06);
  backdrop-filter: blur(6px);
}

.badge.video {
  background: rgba(31, 122, 140, .92);
  color: #fff;
  border-color: transparent;
}

.badge.podcast {
  background: rgba(217, 112, 74, .93);
  color: #fff;
  border-color: transparent;
}

/* Right-hand corner, so it never collides with the format badge. Deliberately quiet: it marks
   something the visitor cannot open, not an error. */
.badge-buy {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 13px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(0, 0, 0, .06);
  backdrop-filter: blur(6px);
  cursor: help;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 14px 15px;
}

.card-title {
  font-size: 14.5px;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.card-meta .dot {
  opacity: .45;
}

.card-meta .price {
  margin-left: auto;
  color: var(--ink);
  font-weight: 500;
}

.card-meta .price.tier {
  color: var(--accent);
}

/* ── creators ─────────────────────────────────────────────────────────────── */
.creators {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
}

.creator {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform .18s, border-color .18s;
}

.creator:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.creator .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 19px;
  color: #fff;
  background: var(--accent);
}

.creator h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.creator .handle {
  font-size: 13px;
  color: var(--muted);
}

.creator p {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* ── states ───────────────────────────────────────────────────────────────── */
.notice {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  font-size: 15px;
}

.notice h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  color: var(--ink);
}

.notice code {
  background: var(--bg-tint);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13px;
}

.skel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.skel .tile {
  animation: pulse 1.4s ease-in-out infinite;
}

.skel .bar {
  height: 11px;
  margin: 13px 14px;
  border-radius: 6px;
  background: var(--bg-tint);
}

.skel .bar.short {
  width: 55%;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .55;
  }
}

.more {
  display: flex;
  justify-content: center;
  padding: 34px 0 8px;
}

.more button {
  font: inherit;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.more button:hover {
  border-color: var(--ink);
}

.more button[disabled] {
  opacity: .5;
  cursor: default;
}

/* ── footer ───────────────────────────────────────────────────────────────── */
.site-foot {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 34px 0 54px;
  color: var(--muted);
  font-size: 13.5px;
}

.site-foot .wrap {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.site-foot a:hover {
  color: var(--accent);
}

.site-foot .spacer {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ── in-marketplace item detail ──────────────────────────────────────────────
   Clicking a card must not bounce the visitor to the public item host, so the
   item opens here instead. The backdrop is its own click target for closing.

   ⚠️ `overflow: hidden` on <body> while the overlay is open is what stops the
   grid behind it scrolling — without it the page moves under the overlay and
   the position you return to is not the position you left.
   ────────────────────────────────────────────────────────────────────────── */
body.overlay-open {
  overflow: hidden;
}

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

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 20, .38);
  backdrop-filter: blur(3px);
}

.overlay-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px -24px rgba(28, 25, 20, .45);
}

.overlay-media {
  background: var(--bg-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  max-height: 56vh;
  overflow: hidden;
}

.overlay-media img {
  width: 100%;
  height: auto;
  max-height: 56vh;
  object-fit: contain;
  display: block;
}

/* A note or podcast has no image — a text panel, never a broken <img>. */
.overlay-text {
  padding: 56px 32px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.35;
  color: var(--ink-soft);
  text-align: center;
}

.overlay-body {
  padding: 20px 24px 26px;
  overflow-y: auto;
}

.overlay-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 23px;
  margin: 8px 0 6px;
  letter-spacing: -.01em;
}

.overlay-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
}

.overlay-meta {
  display: flex;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.overlay-price {
  margin: 14px 0 0;
  font-size: 17px;
  font-weight: 500;
}

.overlay-hint {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.overlay-cta {
  display: inline-block;
  margin-top: 16px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14.5px;
}

.overlay-cta:hover {
  background: var(--accent);
  color: #fff;
}

.overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .92);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
}

.overlay-close:hover {
  background: #fff;
  color: var(--ink);
}

/* ── creator box (inside the item overlay) ──────────────────────────────────
   Everything here is opt-in per field and arrives pre-filtered from the API.
   ⚠️ It must render as ABSENT, not empty, when a creator shows nothing — an
   empty bordered box reads as a broken panel rather than a deliberate choice.
   ──────────────────────────────────────────────────────────────────────── */
.creator-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.creator-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--bg-tint);
}

.creator-avatar.initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 19px;
  color: #fff;
  background: var(--accent);
}

.creator-lines {
  min-width: 0;
}

.creator-name {
  font-weight: 600;
  font-size: 15px;
}

.creator-handle {
  font-size: 13px;
  color: var(--muted);
}

.creator-bio {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.creator-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.clink {
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.clink:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── AI provenance chip ─────────────────────────────────────────────────────
   ⚠️ Three states, three colours, and NO rendering at all for "unset". The
   distinction that matters to a buyer is made-by vs helped-by, so the labels
   are deliberately not a scale of 1–3.
   ──────────────────────────────────────────────────────────────────────── */
.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: help;
}

.ai-chip .ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
}

/* No AI — the reassuring one, so it gets the calmest colour. */
.ai-chip.ai-none {
  border-color: #cfe3d4;
  background: #f2f8f4;
  color: #2f6b46;
}

.ai-chip.ai-none .ai-dot {
  background: #3f8a5b;
}

/* AI-assisted — amber. Reads as "something to know", not as a warning. */
.ai-chip.ai-assisted {
  border-color: #eadcc0;
  background: #fbf6ec;
  color: #7a5a1e;
}

.ai-chip.ai-assisted .ai-dot {
  background: #b98a2a;
}

/* AI-generated — the strongest claim, so it is the most visible. */
.ai-chip.ai-generated {
  border-color: #d9d3ea;
  background: #f5f3fb;
  color: #4b3f7a;
}

.ai-chip.ai-generated .ai-dot {
  background: #6a58a8;
}

@media (max-width: 600px) {
  .overlay {
    padding: 0;
  }

  .overlay-card {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .overlay-media,
  .overlay-media img {
    max-height: 45vh;
  }
}

/* ── header login ─────────────────────────────────────────────────────────── */
/*
 * A <button>, not an <a>: it opens a dialog or menu instead of navigating, and a link that does
 * not navigate lies to middle-click, "open in new tab" and the a11y tree.
 */
.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 1.5px solid transparent;
  padding: 6px 0;
  cursor: pointer;
  white-space: nowrap;
}

.nav-account:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.nav-account-icon {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

/* Signed in: the button shows @handle, so it should read as a state, not another nav link. */
.nav-account.is-in {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ── account menu ──────────────────────────────────────────────────────── */
.account-menu {
  position: fixed;
  z-index: 60;
  width: 330px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
}

.account-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}

.account-menu-head strong {
  display: block;
  font-size: 14px;
}

.account-menu-head span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 9px;
  padding: 9px 10px;
  cursor: pointer;
}

.account-menu-item:hover {
  background: var(--line-soft);
}

/* ── account overview ──────────────────────────────────────────────────── */
.account-block {
  padding: 10px;
  margin: 4px 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #fdfcfb;
}

.account-block-title {
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.account-block-value {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  color: var(--ink);
}

.account-block-sub {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.account-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 6px;
  border-radius: 8px;
  font-size: 13.5px;
}

.account-item:hover {
  background: var(--line-soft);
}

.account-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-item-price {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.account-empty {
  padding: 4px 6px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ── advanced search ───────────────────────────────────────────────────── */
.chip-adv {
  font-style: italic;
}

.adv-wrap {
  padding-bottom: 0;
}

.adv-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 18px;
  margin: 14px 0 18px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.adv-field {
  display: flex;
  flex-direction: column;
}

.adv-label {
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.adv-field input {
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}

.adv-field input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Hint text explains the two filters that cannot behave the way a visitor expects: private
   tags are excluded server-side, and place only ever matches media. */
.adv-hint {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}

.adv-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.adv-apply,
.adv-clear {
  font: inherit;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
}

.adv-apply {
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.adv-clear {
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
}

.adv-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

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

/* ── login dialog ─────────────────────────────────────────────────────────── */
.login-card {
  max-width: 400px;
}

.login-card h2 {
  margin: 0 0 8px;
}

.login-intro {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.login-form {
  display: flex;
  flex-direction: column;
  /* An inset panel so the controls are not flush with the dialog edge — without it the inputs
     read as cut off by the card border rather than placed inside it. */
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fdfcfb;
}

.login-label {
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.login-form input {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  margin-bottom: 14px;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-submit {
  font: inherit;
  font-weight: 600;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.login-submit:disabled {
  opacity: .55;
  cursor: default;
}

/* Reserved height so a status message appearing does not shove the form upward. */
.login-status {
  margin: 12px 0 0;
  min-height: 18px;
  font-size: 13px;
  line-height: 1.4;
}

.login-status.err {
  color: #b3261e;
}

.login-alt {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.login-alt a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}