/* Atelier Bright Magazine Gallery Styles */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-soft: #f5f4f0;
  --border: #e7e5e4;
  --text: #1c1917;
  --muted: #57534e;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --violet: #7c3aed;
  --violet-soft: #faf5ff;
  --shadow: 0 6px 24px rgba(28, 25, 23, 0.06);
  --radius: 16px;
  --header-h: 57px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
body.is-chrome-hidden .site-header {
  transform: translateY(-100%);
  pointer-events: none;
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 18px;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-title-short { display: none; }
.brand-text small { font-size: 11px; color: var(--muted); }

.top-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.is-active { background: var(--primary-soft); color: var(--primary); }

.age-pill {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; min-height: 36px;
}
.age-pill.is-adult { border-color: #fecdd3; background: var(--rose-soft); color: var(--rose); }

.container { max-width: 1180px; margin: 0 auto; padding: 12px 14px 88px; }
.narrow-container { max-width: 820px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-store { background: #1c1917; color: #fff; }
.btn-store.platform-fanza { background: #be123c; }
.btn-store.platform-dlsite { background: #1d4ed8; }
.btn-store.platform-booth { background: #fc4d50; }
.btn-link {
  background: none; border: none; color: var(--primary); font-weight: 700;
  cursor: pointer; font-size: 13px; padding: 4px 6px;
}

.catalog-strip {
  display: grid; gap: 8px; margin-bottom: 12px;
}
.zone-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; width: 100%;
}
.zone-tab {
  min-height: 36px; padding: 6px 11px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 700; font-size: 12px; cursor: pointer;
}
.zone-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.catalog-utility-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.catalog-quick-count { font-size: 12px; font-weight: 700; color: var(--muted); }
.catalog-strip-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sort-pill {
  min-height: 36px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.filter-toggle-btn {
  min-height: 36px; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.filter-toggle-btn.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.custom-avoid-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.custom-avoid-input {
  flex: 1; min-width: 170px; min-height: 36px; padding: 6px 10px; font-size: 13px;
}

.filter-drawer {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px; display: grid; gap: 10px; box-shadow: var(--shadow);
}
.filter-drawer[hidden] { display: none; }

.search-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.search-input, .select-input {
  min-height: 42px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px;
}
.avoid-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.avoid-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.avoid-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 32px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip.is-active { background: var(--rose-soft); border-color: #fda4af; color: var(--rose); }
.result-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}

.works-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px;
}
.works-grid.is-masonry {
  display: flex; align-items: flex-start; gap: 10px;
}
.masonry-col {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px;
}
.works-grid.is-single-col {
  display: grid; grid-template-columns: 1fr; gap: 14px; max-width: 680px; margin: 0 auto;
}
.work-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 2px 10px rgba(28, 25, 23, 0.04);
  display: flex; flex-direction: column; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.work-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-thumb { position: relative; background: var(--surface-soft); overflow: hidden; }
.card-thumb img { width: 100%; height: auto; display: block; }
.card-thumb-link {
  position: relative; z-index: 2; display: block; width: 100%;
}
.card-save-mini, .card-list-mini {
  position: absolute; top: 8px; z-index: 4; min-width: 34px; min-height: 34px;
  border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.92);
  cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted);
}
.card-save-mini { right: 8px; }
.card-list-mini { left: 8px; font-size: 12px; }
.card-save-mini.is-saved { color: var(--rose); border-color: #fda4af; background: var(--rose-soft); }
.card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-body h3 {
  margin: 0; font-size: 13px; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-hook, .works-grid .tag-list { display: none; }
.card-link-area { text-decoration: none; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; background: var(--surface-soft); color: var(--muted);
}
.badge-all_ages { background: var(--primary-soft); color: var(--primary); }
.badge-r18_normal { background: var(--rose-soft); color: var(--rose); }
.badge-r18_fetish { background: var(--violet-soft); color: var(--violet); }
.badge-pr { background: #fef3c7; color: #92400e; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag-pill {
  font-size: 11px; color: var(--muted); background: var(--surface-soft);
  padding: 2px 8px; border-radius: 6px;
}

.empty-state {
  text-align: center; padding: 48px 16px; background: var(--surface);
  border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted);
}
.empty-state-cta { margin-top: 14px; }

/* Detail page */
.breadcrumb { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.breadcrumb a { text-decoration: none; font-size: 13px; font-weight: 700; color: var(--primary); }
.detail-protected.is-locked { filter: blur(18px); pointer-events: none; user-select: none; max-height: 460px; overflow: hidden; }
.detail-protected.is-locked .detail-cover { min-height: 220px; background: var(--surface-soft); }
.r18-curtain {
  background: var(--surface); border: 1px solid #fecdd3; border-radius: var(--radius);
  padding: 24px; margin-bottom: 18px; text-align: center; box-shadow: var(--shadow);
}
.detail-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 24px;
  box-shadow: var(--shadow);
}
.detail-cover { width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.detail-info h1 { margin: 10px 0 8px; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.35; }
.detail-hook { font-weight: 700; margin: 0 0 8px; }
.detail-summary { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.pr-callout { font-size: 12px; font-weight: 700; color: #92400e; background: #fef3c7; padding: 6px 10px; border-radius: 8px; }
.warning-box {
  margin: 14px 0; padding: 12px; border-radius: 10px;
  background: var(--rose-soft); border: 1px solid #fecdd3; font-size: 13px;
}
.warning-box ul { margin: 6px 0 0 18px; padding: 0; }
.specs-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.specs-table th, .specs-table td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: left; }
.specs-table th { width: 120px; color: var(--muted); font-weight: 700; }
.detail-save-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.feedback-share-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.btn-x-share { background: #1c1917; color: #fff; }
.editorial-review-card { background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%); }
.editorial-note {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--primary-soft); border-left: 4px solid var(--primary);
  font-size: 14px; font-weight: 600; color: var(--text);
}
.editorial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.editorial-col {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.editorial-col-warn { background: #fff9f9; border-color: #fecdd3; }
.editorial-col h3 { margin: 0 0 8px; font-size: 13px; }
.editorial-col ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.editorial-col li + li { margin-top: 4px; }

.detail-block {
  margin-top: 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.detail-block h2 { margin: 0 0 14px; font-size: 18px; }
.story-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.story-toolbar h2 { margin: 0; }
.font-size-group { display: flex; gap: 6px; }
.story-reader {
  background: #fdfcf9; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; max-height: 68vh; overflow-y: auto; line-height: 1.9;
}
.story-reader.size-sm { font-size: 14px; }
.story-reader.size-md { font-size: 16px; }
.story-reader.size-lg { font-size: 18px; }
.story-divider { text-align: center; color: var(--muted); margin: 18px 0; }

.sample-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sample-thumb { border: 1px solid var(--border); border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; background: var(--surface-soft); }
.sample-thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.lightbox {
  position: fixed; inset: 0; z-index: 80; background: rgba(28, 25, 23, 0.9);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 90vw; max-height: 84vh; border-radius: 10px; }
.lb-close, .lb-nav {
  position: fixed; min-width: 44px; min-height: 44px; border-radius: 999px;
  border: none; background: rgba(255,255,255,0.92); color: var(--text);
  font-size: 20px; font-weight: 800; cursor: pointer;
}
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* Discover full-screen vertical swipe feed */
body.is-discover { overflow: hidden; height: 100dvh; display: flex; flex-direction: column; background: #f5f4f0; }
body.is-discover .site-header,
body.is-discover .site-footer { display: none; }
.discover-shell { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.discover-topbar {
  position: fixed; top: 10px; left: 12px; right: 12px; z-index: 45;
  pointer-events: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.discover-mode-pills, .discover-top-actions { display: flex; gap: 6px; pointer-events: auto; }
.mini-pill {
  min-height: 34px; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(231,229,228,0.9);
  background: rgba(255,255,255,0.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--text); font-size: 12px; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.08);
}
.mini-pill.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mini-pill[data-discover-mode="r18"].is-active { background: var(--rose); border-color: var(--rose); color: #fff; }
.swipe-hint {
  position: fixed; left: 50%; bottom: 138px; transform: translateX(-50%); z-index: 35;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: rgba(28, 25, 23, 0.82); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  animation: swipeFloat 1.3s ease-in-out infinite;
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}
.swipe-hint[hidden] { display: none; }
.swipe-hint.is-hiding { opacity: 0; pointer-events: none; }
.swipe-chevrons { font-size: 16px; line-height: 1; display: inline-block; }
@keyframes swipeFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -10px); }
}
.discover-feed {
  flex: 1; min-height: 0; overflow-y: scroll; scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}
.discover-slide {
  height: 100%; min-height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center; padding: 12px 16px;
}
.discover-card {
  position: relative; width: min(480px, 100%); height: 100%; max-height: 820px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow);
}
.discover-media { position: relative; width: 100%; height: 100%; background: var(--surface-soft); overflow: hidden; }
.discover-media img.discover-full-img { width: 100%; height: 100%; object-fit: cover; }
.discover-media.is-landscape-stack { background: #f6f4ef; }
.discover-panel-stack {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 52px 8px 142px;
}
.discover-panel {
  flex: 1; min-height: 0; border-radius: 10px; overflow: hidden;
  background: #ffffff; border: 1px solid rgba(231, 229, 228, 0.9);
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.07);
  display: flex; align-items: center; justify-content: center;
}
.discover-panel img { width: 100%; height: 100%; object-fit: contain; background: #fafaf8; }
.discover-media.is-landscape-single { background: #f5f3ee; }
.discover-backdrop-blur {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(22px) brightness(1.08) saturate(0.92); transform: scale(1.12); opacity: 0.48;
  pointer-events: none;
}
.discover-single-stage {
  position: relative; z-index: 2; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; padding: 58px 10px 146px;
}
.discover-single-img {
  width: 100%; max-height: 100%; height: auto; object-fit: contain;
  border-radius: 14px; box-shadow: 0 10px 28px rgba(28, 25, 23, 0.16); background: #ffffff;
}
.discover-rail {
  position: absolute; right: 12px; bottom: 20px; z-index: 20;
  display: flex; flex-direction: column; gap: 10px;
}
.rail-btn {
  min-width: 48px; min-height: 48px; padding: 6px 10px; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--text);
  font-size: 11px; font-weight: 800; text-decoration: none; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  white-space: pre-line; text-align: center; line-height: 1.25;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.rail-btn.is-saved { background: var(--rose-soft); color: var(--rose); border-color: #fda4af; }
.discover-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 52px 74px 18px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.88) 42%, rgba(255,255,255,0.97) 100%);
  pointer-events: none;
}
.discover-quote {
  margin: 6px 0 3px; font-size: 14px; font-weight: 800; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.discover-title {
  margin: 0; font-size: 12px; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.discover-controls {
  position: fixed; right: 20px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 30;
}
.circle-nav {
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 800; cursor: pointer; box-shadow: var(--shadow);
}
.discover-gate-slide {
  height: 100%; min-height: 100%; display: flex; align-items: center;
  justify-content: center; padding: 24px 16px;
}
.discover-gate-card {
  width: min(460px, 100%); background: var(--surface);
  border: 1px solid #fecdd3; border-radius: 20px;
  padding: 28px 24px; text-align: center; box-shadow: var(--shadow);
}
.discover-gate-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: var(--rose-soft); color: var(--rose); margin-bottom: 12px;
}
.discover-gate-title { margin: 0 0 10px; font-size: 20px; line-height: 1.4; }
.discover-gate-desc { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.discover-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.article-card, .page-head {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 14px;
}
.saved-topbar, .saved-detail-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}
.saved-topbar h1 { margin: 0; font-size: 18px; display: inline-flex; align-items: center; }
.saved-total-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 800;
  margin-left: 6px;
}
.saved-header-actions, .saved-detail-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.saved-detail-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.saved-detail-title {
  margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.saved-global-search-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saved-global-search-bar .search-input { flex: 1; min-width: 200px; }
.collection-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px;
}
.collection-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 2px 10px rgba(28, 25, 23, 0.05);
  display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.collection-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.collection-collage {
  width: 100%; aspect-ratio: 4 / 3; background: var(--surface-soft); overflow: hidden;
  display: grid; gap: 2px;
}
.collection-collage.collage-1 { grid-template-columns: 1fr; }
.collection-collage.collage-2 { grid-template-columns: 1fr 1fr; }
.collection-collage.collage-3,
.collection-collage.collage-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collection-collage img { width: 100%; height: 100%; object-fit: cover; }
.collage-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 26px; font-weight: 700;
}
.collection-meta { padding: 10px 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.collection-meta strong { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-meta span { font-size: 11px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.danger-chip { color: var(--rose); border-color: #fecdd3; background: var(--rose-soft); }
.saved-search-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; }
.saved-tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.saved-tag-chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.save-toast {
  position: fixed; left: 50%; bottom: calc(68px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 85;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(28, 25, 23, 0.92); color: #fff; padding: 8px 10px 8px 14px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.24); white-space: nowrap;
}
body.is-discover .save-toast { top: 56px; bottom: auto; }
.save-toast[hidden] { display: none; }
.save-toast-btn {
  border: none; border-radius: 999px; background: var(--primary); color: #fff;
  padding: 5px 11px; font-size: 11px; font-weight: 800; cursor: pointer;
}
.list-picker-items { display: grid; gap: 8px; margin-bottom: 12px; max-height: 240px; overflow-y: auto; }
.list-picker-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  background: var(--bg); font-size: 13px; font-weight: 700;
}
.list-picker-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.list-picker-create { display: flex; gap: 8px; }
.list-picker-create .search-input { flex: 1; min-width: 0; }
.modal-card-wide { width: min(560px, 100%); max-height: 88dvh; overflow-y: auto; }
.backup-section { margin-top: 12px; }
.backup-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.backup-textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px;
  background: var(--bg); color: var(--text); resize: vertical;
}
.backup-file-input { font-size: 12px; max-width: 100%; }
.modal-actions-top { margin-top: 14px; }
.backup-actions { margin-top: 8px; }
.backup-status { margin: 8px 0 0; }
.social-row { display: flex; flex-wrap: wrap; gap: 10px; }
.muted { color: var(--muted); font-size: 13px; }

.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 20px 16px 84px; font-size: 12px; color: var(--muted);
}
.footer-inner { max-width: 1180px; margin: 0 auto; }
.footer-inner p { margin: 4px 0; }

.mobile-tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
}
.tab-btn {
  flex: 1; min-height: 46px; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 12px; font-weight: 700; color: var(--muted); border-radius: 10px;
}
.tab-btn.is-active { color: var(--primary); background: var(--primary-soft); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(28, 25, 23, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: min(460px, 100%); background: var(--surface); border-radius: var(--radius);
  padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.modal-eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: var(--rose); }
.modal-card h2 { margin: 0 0 10px; font-size: 20px; }
.modal-copy { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.sticky-toolbar-wrap {
  position: sticky; top: var(--header-h); z-index: 38;
  background: rgba(250, 250, 248, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  margin: -12px -14px 12px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid transparent;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}
.sticky-toolbar-wrap.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 18px rgba(28, 25, 23, 0.08);
}
body.is-chrome-hidden .sticky-toolbar-wrap {
  transform: translateY(calc(-100% - var(--header-h) - 16px));
  pointer-events: none;
}
.sticky-toolbar-wrap .catalog-strip,
.sticky-toolbar-wrap .saved-detail-bar {
  margin-bottom: 0;
}
.sticky-toolbar-wrap .filter-drawer {
  margin-top: 10px;
  margin-bottom: 0;
  max-height: 60dvh;
  overflow-y: auto;
}

@media (max-width: 768px) {
  :root { --header-h: 47px; }
  .header-inner { padding: 7px 12px; gap: 8px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
  .brand-title-full, .brand-sub { display: none; }
  .brand-title-short { display: inline; font-size: 14px; }
  .age-pill { min-height: 32px; padding: 4px 10px; font-size: 11px; }
  .top-nav { display: none; }
  .mobile-tabbar { display: flex; gap: 4px; }
  .desktop-only-pill { display: none; }
  .search-row { grid-template-columns: 1fr; }
  .saved-search-row { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .detail-hero { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .article-card { padding: 16px; }
  .discover-slide { padding: 0; }
  .discover-card { width: 100%; max-height: none; border-radius: 0; border: none; }
  .discover-panel-stack { padding: 52px 6px 158px; }
  .discover-single-stage { padding: 58px 8px 158px; }
  .discover-caption { padding-bottom: 72px; }
  .discover-rail { bottom: 76px; }
  .swipe-hint { bottom: 174px; }
  .discover-controls { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .sticky-toolbar-wrap { transition: none; }
}
