* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, var(--glow-a), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 0%, var(--glow-b), transparent 45%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 40%, var(--bg-end));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background 0.35s ease, color 0.25s ease;
  /* Extend into iOS safe areas so chrome tint matches theme */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background-color: var(--bg0);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.75rem);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.brand span { color: var(--accent); }
.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 0.4rem;
}
.nav { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--ink); }
.theme-picker { margin: 0; display: inline-flex; align-items: center; }
.theme-picker select {
  width: auto; max-width: 9.5rem; margin: 0; padding: 0.35rem 0.5rem;
  font-size: 0.85rem; border-radius: 6px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.inline-form { display: inline; margin: 0; }
.link-btn {
  background: none; border: none; color: var(--muted); font: inherit; cursor: pointer; padding: 0;
}
.link-btn:hover { color: var(--ink); }

.site-main {
  flex: 1;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 3vw, 2.75rem) 2.5rem;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem clamp(1rem, 3vw, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  width: 100%;
}
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Homepage: use the width on large screens */
.home-top {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 0.5rem;
}
.home-features {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.home-features h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 0 0 0.65rem;
}
.feature-list {
  line-height: 1.65;
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  flex: 1;
}
.home-feature-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.home-gallery {
  margin-top: 2rem;
}
.home-gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.home-gallery-head h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 0;
  color: var(--muted);
}
.grid-dense {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
@media (min-width: 900px) {
  .home-top {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 1.75rem;
  }
  .hero {
    padding: 1.75rem 0 1rem;
  }
  .hero h1 {
    max-width: 16ch;
    font-size: clamp(2.6rem, 4.2vw, 3.9rem);
  }
  .hero p { max-width: 46ch; }
}
@media (min-width: 1200px) {
  .grid-dense {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.hero {
  display: grid;
  gap: 1.25rem;
  padding: 2.5rem 0 2rem;
  animation: rise 0.7s ease both;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0;
  max-width: 14ch;
}
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 42ch; margin: 0; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--btn-ink); font-weight: 700;
  border: none; border-radius: 999px; padding: 0.7rem 1.25rem; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--accent-hover); color: var(--btn-ink); transform: translateY(-1px); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
.btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-danger { background: var(--danger); color: #1a0505; }

.flash {
  padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  animation: rise 0.35s ease both;
}
.flash.ok { background: color-mix(in srgb, var(--accent) 18%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.flash.err { background: color-mix(in srgb, var(--danger) 18%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.panel h1, .panel h2 { font-family: var(--display); margin-top: 0; }

label { display: block; margin: 0.75rem 0 0.35rem; color: var(--muted); font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=file], select, textarea {
  width: 100%; max-width: 420px;
  background: var(--bg0); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 0.65rem 0.75rem; font: inherit;
}
textarea { max-width: 100%; min-height: 100px; }
.checkbox { display: flex; gap: 0.5rem; align-items: center; margin: 0.75rem 0; color: var(--muted); }
.checkbox input { width: auto; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}
.tile {
  display: block; position: relative; overflow: hidden; border-radius: 10px;
  aspect-ratio: 1; background: var(--bg2); border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: rise 0.5s ease both;
}
.tile:hover { transform: translateY(-3px); border-color: var(--accent-dim); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0.4rem 0.5rem; font-size: 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
}

.pager { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.25rem; color: var(--muted); }

.meter {
  height: 8px; background: var(--bg0); border-radius: 999px; overflow: hidden; margin-top: 0.4rem;
}
.meter > span { display: block; height: 100%; background: var(--accent); }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; }

pre.mono {
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.45;
}
.legal h1 { font-family: var(--display); }
.legal h2 { margin-top: 1.75rem; font-size: 1.15rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; word-break: break-all; }

.copy-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.copy-row input {
  max-width: 100%;
  flex: 1;
  min-width: 200px;
  white-space: nowrap;
  overflow-x: auto;
  word-break: normal;
  overflow-wrap: normal;
}
.dash-links { max-width: 28rem; }
.dash-links .copy-row { margin: 0.3rem 0; }
.dash-links .copy-row-btn .muted { min-width: 4.75rem; }

.img-hero-wrap {
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  background:
    linear-gradient(45deg, var(--bg2) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, var(--bg2) 25%, transparent 25%) 0 8px / 16px 16px,
    linear-gradient(45deg, transparent 75%, var(--bg2) 75%) 8px -8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, var(--bg2) 75%) -8px 0 / 16px 16px;
  background-color: var(--bg0);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 0.5rem;
}
.img-hero {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  image-rendering: auto;
  border-radius: 4px;
  animation: fade 0.6s ease both;
}

.ad-slot {
  margin: 0.75rem 0 1rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.65rem;
  background: color-mix(in srgb, var(--bg0) 60%, transparent);
}
.ad-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.ad-placeholder {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem;
}

/* Theme picker */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.theme-card {
  text-align: left;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.theme-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.theme-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-swatch {
  height: 72px;
  display: flex;
  align-items: flex-end;
  padding: 0.5rem;
  gap: 0.35rem;
}
.theme-swatch i {
  width: 18px; height: 18px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
}
.theme-meta { padding: 0.85rem 1rem 1rem; }
.theme-meta strong { display: block; font-family: var(--display); margin-bottom: 0.25rem; }
.theme-meta span { color: var(--muted); font-size: 0.85rem; }

[data-theme="jarvis"] .site-header {
  border-bottom-color: rgba(79, 210, 255, 0.25);
  box-shadow: 0 0 24px rgba(79, 210, 255, 0.06);
}
[data-theme="jarvis"] .brand span {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(79, 210, 255, 0.45);
}
[data-theme="jarvis"] .btn {
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(79, 210, 255, 0.25);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pixgb-drop-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg0) 72%, transparent);
  border: 3px dashed var(--accent);
  pointer-events: none;
}
.pixgb-drop-overlay.active { display: flex; }
.pixgb-drop-overlay-inner {
  font-family: var(--display); font-size: 1.6rem; color: var(--ink);
  padding: 1.5rem 2rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.pixgb-toast-host {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 1100;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: min(360px, 92vw);
}
.pixgb-toast {
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  padding: 0.75rem 1rem; border-radius: 8px; opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.pixgb-toast.show { opacity: 1; transform: none; }
.pixgb-toast.err { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.pixgb-quick-results { margin-top: 1rem; }
.pixgb-quick-list { display: grid; gap: 1rem; }
.pixgb-quick-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: start;
  padding: 0.75rem 0; border-top: 1px solid var(--line);
}
.pixgb-quick-thumb img {
  width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
}
.copy-row-btn { align-items: center; }
.copy-row-btn .muted { min-width: 4.5rem; font-size: 0.8rem; }
.copy-actions { display: grid; gap: 0.35rem; }
.share-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.qr-wrap {
  display: inline-block; padding: 0.75rem; background: #fff; border-radius: 8px;
  margin-top: 0.75rem; line-height: 0;
}
.qr-wrap canvas, .qr-wrap img { display: block; }
.hero-drop-hint {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1rem 1.15rem; color: var(--muted); font-size: 0.95rem; max-width: 40rem;
}
.pixgb-file-input {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.pixgb-pick-zone {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 25%, transparent);
  user-select: none;
}
.pixgb-pick-zone:hover,
.pixgb-pick-zone:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--ink);
  outline: none;
}
.pixgb-pick-zone:active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.pixgb-pick-cta {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.55rem;
}
.pixgb-pick-tap {
  display: none;
  color: var(--accent);
  font-size: 1.05rem;
}
.pixgb-pick-desk {
  font-size: 0.88rem;
  color: var(--muted);
}
@media (hover: none), (max-width: 720px) {
  .pixgb-pick-tap { display: block; }
  .pixgb-pick-desk { display: none; }
  .pixgb-pick-zone {
    padding: 1.25rem 1.15rem;
    min-height: 5.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-style: solid;
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }
  .pixgb-pick-cta { margin-top: 0.35rem; }
}

.album-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.album-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg0) 55%, transparent);
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.album-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  color: inherit;
}
.album-card-thumbs {
  display: flex;
  gap: 0.35rem;
  min-width: 3.5rem;
}
.album-card-thumbs img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg0);
}
.album-card-empty {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.65rem;
  text-align: center;
  padding: 0.25rem;
  line-height: 1.2;
}
.album-card-meta {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.album-card-meta strong {
  color: var(--ink);
}
.album-card-meta .muted {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-card-actions {
  padding: 0 0.85rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.album-card-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem 0.85rem 0.35rem;
  text-decoration: none;
  color: inherit;
}
.integrity-badge {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.integrity-mark {
  display: inline-flex;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg0);
  font-weight: 800;
  flex-shrink: 0;
}
.embed-health {
  margin: 1rem 0 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg1);
}
.embed-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}
.embed-health-grid > div {
  display: grid;
  gap: 0.15rem;
}
.embed-chip {
  font-size: 0.75rem;
  margin-bottom: 0.45rem;
}
.forum-packs {
  margin-top: 0.45rem;
  font-size: 0.85rem;
}
.forum-packs summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.album-share-box {
  margin: 1rem 0 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg1);
}

.pixgb-upload-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.9rem;
}
.pixgb-upload-opts-label { margin: 0; font-weight: 600; }
.pixgb-expiry-select {
  min-width: 10rem;
  max-width: 100%;
}
.pixgb-strip-exif-label { margin: 0; }

.pixgb-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pixgb-editor-modal[hidden] { display: none !important; }
.pixgb-editor-dialog {
  width: min(960px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--bg0, #111);
  color: var(--text, #eee);
  border: 1px solid var(--line, #333);
  border-radius: 12px;
  padding: 0.75rem;
}
.pixgb-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.pixgb-editor-spacer { flex: 1; }
.pixgb-editor-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background: var(--bg1, #1a1a1a);
  border-radius: 8px;
  overflow: hidden;
}
.pixgb-editor-canvas {
  max-width: 100%;
  cursor: crosshair;
  touch-action: none;
}
.pixgb-editor-sel {
  position: absolute;
  border: 2px dashed var(--accent, #6cf);
  background: rgba(100, 180, 255, 0.15);
  pointer-events: none;
}
.pixgb-editor-hint { margin: 0.55rem 0 0; font-size: 0.85rem; }

.hotlink-form .checkbox { display: flex; gap: 0.35rem; align-items: center; }

/* —— Library redesign —— */
.lib-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.lib-hero h1 { margin-bottom: 0.25rem; }
.lib-plan { margin: 0; }
.lib-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.lib-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 0.25rem 0 0.5rem;
}
.lib-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.lib-note { font-size: 0.88rem; margin: 0.75rem 0 0; }
.lib-api {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}
.lib-api summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.lib-api summary:hover { color: var(--ink); }
.lib-api-body { margin-top: 0.75rem; }
.lib-api-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.65rem;
}
.lib-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.lib-section-head h2 { margin: 0; }
.lib-album-create {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.lib-album-create input[type="text"] {
  flex: 1;
  min-width: 12rem;
  margin: 0;
}
.lib-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}
.lib-cards {
  display: grid;
  gap: 1rem;
}
.lib-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg0) 55%, transparent);
}
.lib-card-thumb {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg0);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.lib-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lib-card-body { min-width: 0; }
.lib-card-title-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.lib-card-title strong {
  color: var(--ink);
  font-size: 1.02rem;
  word-break: break-word;
}
.lib-card-meta {
  font-size: 0.82rem;
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  align-items: center;
}
.lib-card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.lib-pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--line);
}
.lib-pill-pub {
  color: #7dcea0;
  border-color: color-mix(in srgb, #7dcea0 45%, var(--line));
  background: color-mix(in srgb, #7dcea0 12%, transparent);
}
.lib-pill-priv {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
}
.lib-pill-lock {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.lib-health {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0.7rem 0 0.85rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  font-size: 0.8rem;
  color: var(--muted);
}
.lib-health strong { color: var(--ink); font-weight: 700; }
.lib-quick-copies {
  display: grid;
  gap: 0.4rem;
}
.lib-copy {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 0.4rem;
  align-items: center;
}
.lib-copy-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.lib-copy input {
  margin: 0;
  font-size: 0.78rem;
  min-width: 0;
}
.lib-more {
  margin-top: 0.85rem;
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
}
.lib-more > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 650;
  font-size: 0.9rem;
  list-style: none;
}
.lib-more > summary::-webkit-details-marker { display: none; }
.lib-more > summary::before {
  content: "▸ ";
  color: var(--muted);
}
.lib-more[open] > summary::before { content: "▾ "; }
.lib-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-top: 0.85rem;
}
.lib-more-block h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.5rem;
  font-family: var(--font);
  font-weight: 700;
}
.lib-pack-list {
  display: grid;
  gap: 0.35rem;
  max-height: 16rem;
  overflow: auto;
  padding-right: 0.25rem;
}
.lib-inline-form {
  display: grid;
  gap: 0.45rem;
}
.lib-inline-form input,
.lib-inline-form select {
  margin: 0;
  width: 100%;
}
.lib-slug-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}
.lib-replace input[type="file"] {
  font-size: 0.8rem;
}
.lib-sha {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem 0.55rem;
  align-items: start;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg0);
}
.lib-sha-value {
  display: block;
  font-size: 0.72rem;
  line-height: 1.45;
  word-break: break-all;
  overflow-wrap: anywhere;
  color: var(--ink);
  margin: 0;
  white-space: normal;
}
.lib-link-settings {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg0) 50%, transparent);
}
.lib-link-settings > summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--accent);
  list-style: none;
}
.lib-link-settings > summary::-webkit-details-marker { display: none; }
.lib-link-settings > summary::before { content: "▸ "; color: var(--muted); }
.lib-link-settings[open] > summary::before { content: "▾ "; }
.lib-link-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.35rem 0.75rem;
}
.lib-link-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.lib-pref-select {
  width: auto;
  min-width: 10rem;
  margin: 0;
}
.lib-one-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.15rem 0 0.55rem;
}
.lib-links-fold {
  margin: 0 0 0.55rem;
}
.lib-links-fold > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 650;
  font-size: 0.9rem;
  list-style: none;
}
.lib-links-fold > summary::-webkit-details-marker { display: none; }
.lib-links-fold > summary::before { content: "▸ "; color: var(--muted); }
.lib-links-fold[open] > summary::before { content: "▾ "; }
.lib-links-fold .lib-links-body {
  margin-top: 0.55rem;
}

/* —— Mobile-first polish —— */
@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
  }
  .brand { font-size: 1.35rem; }
  .nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.15rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
    margin: 0 -0.15rem;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a,
  .nav .theme-picker,
  .nav form {
    flex: 0 0 auto;
  }
  .nav a {
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg0) 70%, transparent);
    border: 1px solid var(--line);
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .theme-picker select { max-width: 7.5rem; font-size: 0.8rem; }
  .site-main {
    padding: 1rem 0.85rem 2rem;
    width: 100%;
  }
  .site-footer {
    padding: 1rem 0.85rem;
    font-size: 0.82rem;
  }
  .panel {
    padding: 0.95rem 0.9rem;
    border-radius: 12px;
  }
  .panel h1 { font-size: 1.45rem; }
  .hero h1 { font-size: clamp(1.55rem, 7vw, 2.1rem); line-height: 1.15; }
  .hero p { font-size: 0.95rem; }
  .hero-actions {
    display: grid;
    gap: 0.5rem;
  }
  .hero-actions .btn,
  .hero-actions .btn-ghost {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .home-top { gap: 1rem; }
  .home-features { padding: 0.95rem; }
  .feature-list { padding-left: 1rem; font-size: 0.9rem; }
  .btn, .btn-sm {
    min-height: 2.5rem;
  }
  .copy-row-btn {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .copy-row-btn .muted { min-width: 0; }
  .copy-row-btn input {
    width: 100%;
    font-size: 0.78rem;
  }
  .copy-row-btn .btn { width: 100%; }
  .pixgb-quick-card {
    grid-template-columns: 1fr;
  }
  .pixgb-quick-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
  }
  .img-hero-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
  .img-hero {
    max-width: 100%;
    height: auto;
  }
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .lib-hero-top { gap: 0.75rem; }
  .lib-hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .lib-hero-actions .btn,
  .lib-hero-actions a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .lib-meters { grid-template-columns: 1fr; }
  .lib-meter-head { flex-direction: column; gap: 0.15rem; }
  .lib-album-create {
    flex-direction: column;
    align-items: stretch;
  }
  .lib-album-create input[type="text"] { min-width: 0; width: 100%; }
  .lib-card {
    grid-template-columns: 1fr;
    padding: 0.85rem;
    gap: 0.75rem;
  }
  .lib-card-thumb {
    width: 100%;
    height: 200px;
  }
  .lib-card-title-row {
    flex-direction: column;
    align-items: stretch;
  }
  .lib-card-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .lib-card-tools .btn,
  .lib-card-tools form { width: 100%; }
  .lib-card-tools .btn { width: 100%; }
  .lib-health {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.65rem;
  }
  .lib-sha {
    grid-template-columns: 1fr;
  }
  .lib-sha .btn { width: 100%; }
  .lib-copy {
    grid-template-columns: 1fr;
  }
  .lib-copy-label { margin-bottom: -0.1rem; }
  .lib-copy .btn { width: 100%; }
  .lib-more-grid { grid-template-columns: 1fr; }
  .lib-slug-row { grid-template-columns: 1fr; }
  .album-card { grid-template-columns: 1fr; }
  .album-card-main {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }
  .album-card-thumbs { flex-wrap: wrap; }
  .integrity-badge { flex-direction: column; gap: 0.5rem; }
  .integrity-badge .mono {
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: 0.72rem;
  }
  .embed-health-grid { grid-template-columns: 1fr 1fr; }
  .share-toolbar { display: grid; grid-template-columns: 1fr; }
  .share-toolbar .btn { width: 100%; }
  .pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 720px) {
  .lib-card {
    grid-template-columns: 1fr;
  }
  .lib-card-thumb {
    width: 100%;
    height: 200px;
  }
  .lib-copy {
    grid-template-columns: 1fr;
  }
  .lib-copy-label { margin-bottom: -0.15rem; }
}

.trust-callout {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #7dcea0 45%, var(--line));
  background: color-mix(in srgb, #7dcea0 10%, var(--bg1));
}
.smartscreen-box {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg1);
}

@media (max-width: 640px) {
  .hero { padding-top: 0.75rem; }
  .pixgb-quick-card { grid-template-columns: 1fr; }
  .pixgb-toast-host {
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    max-width: none;
  }
}

