/* =========================================================
   tattoodesigns.ai — library layer (png.ai-style)
   nav · home hero · masonry design grid · collection header ·
   sub-tabs · toolbar · collection cards · trending · detail ·
   directory · stencils · converters · try-on · search
   ========================================================= */

/* ---------- nav: explore / tools dropdowns + search ---------- */
.site-nav .container-wide { gap: 18px; }
.nav-drop { position: relative; }
.nav-drop summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: var(--r-full); font-size: 14px; cursor: pointer; color: var(--fg); }
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary:hover, .nav-drop[open] summary { background: var(--bg-hover); color: var(--fg-strong); }
.nav-drop .drop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 260px; padding: 6px; border-radius: var(--r-md); background: var(--bg-elev); box-shadow: var(--shadow-lg); display: grid; }
.drop-item { display: flex; flex-direction: column; padding: 9px 12px; border-radius: 9px; font-size: 14px; }
.drop-item:hover { background: var(--bg-hover); }
.drop-item strong { font-weight: 500; color: var(--fg-strong); }
.drop-item small { font-size: 12px; color: var(--fg-muted); }
.nav-search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-full); background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--border); color: var(--fg-muted); }
.nav-search:focus-within { box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--fg-strong); }
.nav-search.m { max-width: none; margin-bottom: 8px; height: 46px; }
.nav-actions { margin-left: 0; }
@media (max-width: 1080px) { .hide-md { display: none; } }
@media (max-width: 860px) { .site-nav .nav-search { display: none; } .nav-actions { margin-left: auto; } }

/* ---------- home hero (library + create) ---------- */
.home-hero { padding: 56px 0 64px; }
.hero-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero-h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; color: var(--fg-strong); letter-spacing: -.01em; margin-top: 14px; }
.hero-h1 em { color: var(--accent); font-style: italic; }
.hero-sub { margin-top: 18px; max-width: 520px; font-size: 16px; color: var(--fg-muted); }
.hero-search { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding: 6px 6px 6px 18px; border-radius: var(--r-full); background: var(--bg-elev); box-shadow: var(--shadow-md); max-width: 560px; color: var(--fg-muted); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; height: 40px; color: var(--fg-strong); }
.hero-stats { display: flex; gap: 32px; margin-top: 30px; }
.hero-stats b { display: block; font-family: var(--font-serif); font-weight: 400; font-size: 30px; color: var(--fg-strong); line-height: 1.1; }
.hero-stats span { font-size: 12px; color: var(--fg-muted); }
.hero-collage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; border-radius: 26px; background: rgba(255, 236, 210, .05); box-shadow: inset 0 0 0 1px var(--border); }
.hero-collage a:nth-child(3n+2) { transform: translateY(18px); }
.hero-collage .thumb { border-radius: 14px; transition: transform .25s var(--ease); }
.hero-collage a:hover .thumb { transform: scale(1.03); }
@media (max-width: 900px) { .hero-split { grid-template-columns: 1fr; gap: 32px; } .hero-collage { max-width: 520px; } .home-hero { padding: 36px 0 48px; } }

.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }

/* ---------- masonry design grid + cards ---------- */
/* Every card of a grid has the same shape, so the cards fill rows left to right: up to 5 columns, none narrower
   than 160px. (A CSS multi-column layout balanced equal cards into 4 columns and left the 5th empty for 7, 8, 12
   or 16 designs.) */
.masonry-grid { --grid-gap: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(max(160px, calc((100% - 4 * var(--grid-gap)) / 5)), 1fr)); gap: var(--grid-gap); align-items: start; }
@media (max-width: 640px) { .masonry-grid { --grid-gap: 10px; } .d-title { font-size: 12px; } }
.masonry-grid > * { min-width: 0; }
.d-card { display: block; position: relative; }
.d-card .thumb { border-radius: var(--r-md); transition: box-shadow .2s, transform .2s var(--ease); }
.d-card .thumb > svg { width: 74%; height: 74%; }
.d-card:hover .thumb { box-shadow: 0 0 0 1.5px var(--border-strong), var(--shadow-md); transform: translateY(-2px); }
.d-title { display: block; padding: 8px 4px 0; min-height: 24px; font-size: 13px; font-weight: 500; color: var(--fg-strong); line-height: 1.35; }
.d-card:hover .d-title { color: var(--accent); }
.thumb-stencil { background: #FFFFFF; color: #5B3FC4; --art-bg: #FFFFFF; box-shadow: inset 0 0 0 1px var(--border); }
/* view switch (Mixed / Design / On skin / Stencil) */
[data-view="paper"] .thumb.thumb, [data-v="paper"] .thumb.thumb { background: var(--paper); color: var(--paper-ink); --art-bg: var(--paper); }
[data-view="skin"] .thumb.thumb, [data-v="skin"] .thumb.thumb { background: radial-gradient(120% 90% at 30% 20%, #E9C9AE, #C99A79 70%, #B9876A); color: #2B2420; --art-bg: #D7AF92; }
[data-view="stencil"] .thumb.thumb, [data-v="stencil"] .thumb.thumb { background: #FFFFFF; color: #5B3FC4; --art-bg: #FFFFFF; box-shadow: inset 0 0 0 1px var(--border); }
[data-view="skin"] .thumb > svg, [data-v="skin"] .thumb > svg { mix-blend-mode: multiply; opacity: .88; }
[data-view="paper"] .thumb > svg, [data-view="stencil"] .thumb > svg, [data-v="paper"] .thumb > svg, [data-v="stencil"] .thumb > svg { mix-blend-mode: normal; opacity: 1; }
[data-v="ink"] .thumb.thumb { background: #111111; color: #FFFFFF; --art-bg: #111111; }

/* ---------- collection header ---------- */
.coll-head { padding: 22px 0 6px; }
.coll-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.coll-h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.05; color: var(--fg-strong); letter-spacing: -.01em; margin-top: 6px; }
.coll-lead { max-width: 680px; margin-top: 10px; color: var(--fg-muted); font-size: 15.5px; }
.coll-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-tabs { display: flex; gap: 6px; overflow-x: auto; margin-top: 22px; padding: 4px 0; scrollbar-width: none; }
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tab { flex: none; height: 36px; padding: 0 14px; border-radius: var(--r-full); display: inline-flex; align-items: center; font-size: 13.5px; font-weight: 500; color: var(--fg); background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--border); white-space: nowrap; }
.sub-tab:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.sub-tab.is-active { background: var(--ink); color: var(--fg-on-ink); box-shadow: none; }
.center-tabs { justify-content: center; margin: -6px 0 22px; }
.lib-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.tb-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tb-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.tb-view { min-width: 320px; }
@media (max-width: 640px) { .tb-view { min-width: 0; width: 100%; } .coll-actions { width: 100%; } }

/* ---------- collection cards (2×2 mosaic) ---------- */
.coll-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.coll-card { display: flex; flex-direction: column; padding: 8px 8px 14px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s var(--ease); }
.coll-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 12px; overflow: hidden; }
.mosaic .thumb { border-radius: 0; }
.mosaic .thumb > svg { width: 70%; height: 70%; }
.coll-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 2px; font-size: 14px; font-weight: 600; color: var(--fg-strong); }
.coll-name .i { width: 15px; height: 15px; color: var(--accent); }
.coll-meta { padding: 0 6px; font-size: 12px; color: var(--fg-muted); }
@media (max-width: 1000px) { .coll-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .coll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---------- trending searches ---------- */
.trend-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.trend { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: var(--r-md); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.trend:hover { box-shadow: var(--shadow-md); }
.trend .rank { font-family: var(--font-serif); font-size: 20px; color: var(--accent); min-width: 34px; text-align: center; }
.trend .thumb { width: 48px; flex: none; border-radius: 10px; }
.trend .thumb > svg { width: 80%; height: 80%; }
.trend-name { font-size: 14px; font-weight: 500; color: var(--fg-strong); line-height: 1.3; }
@media (max-width: 1000px) { .trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .trend-grid { grid-template-columns: 1fr; } }
.browse-two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .browse-two { grid-template-columns: 1fr; } }

/* ---------- stencil cards ---------- */
.stencil-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.s-card { padding: 8px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.s-card .thumb > svg { width: 72%; height: 72%; }
.s-bar { display: flex; align-items: center; gap: 8px; padding: 10px 2px 2px; }
.s-bar .d-title { flex: 1; padding: 0; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-bar .btn { flex: none; }

/* ---------- inline generator band on collection pages ---------- */
.gen-band { padding: 36px; border-radius: 28px; }
.gen-band-head { margin-bottom: 20px; }
.gen-band .gen-card textarea { min-height: 64px; }
.gen-band .gen-foot { border-top: 0; padding-top: 4px; }
@media (max-width: 640px) { .gen-band { padding: 22px 16px; border-radius: 20px; } }

/* ---------- placement at-a-glance ---------- */
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 22px 0 6px; border-radius: var(--r-md); overflow: hidden; background: var(--border); box-shadow: var(--shadow-sm); }
.glance > div { background: var(--bg-elev); padding: 12px 14px; }
.glance span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); }
.glance b { font-size: 14px; font-weight: 500; color: var(--fg-strong); line-height: 1.4; }
.glance .pain { display: inline-flex; gap: 3px; margin-top: 4px; }
.glance .pain i { width: 9px; height: 9px; border-radius: 2px; background: var(--bg-active); }
.glance .pain i.on { background: var(--accent); }
@media (max-width: 640px) { .glance { grid-template-columns: 1fr 1fr; } }

/* ---------- design detail (/p/) ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; margin-top: 18px; align-items: start; }
.detail-media { position: sticky; top: calc(var(--nav-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.detail-stage .thumb { border-radius: var(--r-xl); box-shadow: var(--shadow-sm); }
.detail-stage .thumb > svg { width: 72%; height: 72%; }
.detail-views { align-self: center; min-width: 300px; }
.detail-variants { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.detail-variants .thumb { border-radius: 10px; }
.detail-variants a:hover .thumb { box-shadow: 0 0 0 1.5px var(--ink); }
.detail-info { display: flex; flex-direction: column; gap: 16px; }
.detail-h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; color: var(--fg-strong); }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--border); box-shadow: var(--shadow-sm); }
.specs div { background: var(--bg-elev); padding: 10px 14px; }
.specs dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); }
.specs div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.specs dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: var(--fg-strong); }
.detail-cta, .detail-dl { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-cta .btn { flex: 1; min-width: 200px; }
.license { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--bg-elev); box-shadow: var(--shadow-sm); font-size: 13px; }
.license .i { color: var(--ok); margin-top: 1px; }
.license strong { display: block; color: var(--fg-strong); font-weight: 600; }
.license span { color: var(--fg-muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; gap: 24px; } .detail-media { position: static; } .detail-views { min-width: 0; width: 100%; } }

/* ---------- home first screen: Find ideas / Create with AI (one box, two modes; compact so the gallery shows on a laptop) ---------- */
.home-hero.hero-dual { padding: 20px 0 24px; border-bottom: 0; }
.hero-stage { position: relative; overflow: hidden; border-radius: 28px; background: var(--bg-sunken); padding: 80px 24px 76px; }
.hero-center { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; text-align: center; }
.hero-dual .hero-h1 { margin-top: 0; font-size: clamp(36px, 4.1vw, 60px); line-height: 1.06; }
.hero-dual .hero-sub { margin: 16px auto 0; max-width: 660px; font-size: 18px; }
.hero-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-width: 500px; margin: 34px auto 16px; padding: 4px; border-radius: var(--r-full); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.hero-modes button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: var(--r-full); font-size: 15.5px; font-weight: 600; color: var(--fg-muted); transition: background .15s, color .15s; }
.hero-modes button:hover { color: var(--fg-strong); }
.hero-modes button.is-active { background: var(--ink); color: var(--fg-on-ink); }
.hero-panel { max-width: 860px; margin: 0 auto; }
.hero-search.hero-search-lg { max-width: none; margin-top: 0; padding: 7px 7px 7px 22px; }
.hero-search-lg input { height: 50px; font-size: 16.5px; }
.hero-search-lg .btn { --h: 50px; padding: 0 26px; }
.hero-dual .hero-gen { max-width: none; margin-top: 0; padding: 10px 12px 10px; text-align: left; }
.hero-dual .hero-gen textarea { min-height: 52px; font-size: 16px; }
.hero-dual .hero-gen-foot { margin-top: 4px; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.hero-try { margin: 22px 0 10px; font-size: 13px; color: var(--fg-muted); }
.hero-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 4px; border-radius: var(--r-full); background: var(--bg-elev); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 500; color: var(--fg-strong); }
.hero-chip:hover { box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-sm); }
.hero-chip .thumb { position: relative; width: 32px; height: 32px; flex: none; border-radius: 50%; overflow: hidden; }
.hero-chip .thumb > svg { width: 80%; height: 80%; }
.hero-chip-text { padding: 0 15px; font-size: 13.5px; }
.hero-deco img { position: absolute; width: 150px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 18px; box-shadow: var(--shadow-md); }
.hero-deco .hd1 { left: 28px; top: 172px; transform: rotate(-7deg); }
.hero-deco .hd2 { left: 44px; bottom: -92px; transform: rotate(5deg); }
.hero-deco .hd3 { right: 28px; top: 180px; transform: rotate(6deg); }
.hero-deco .hd4 { right: 44px; bottom: -88px; transform: rotate(-5deg); }
@media (max-width: 1360px) { .hero-deco img { width: 124px; } .hero-deco .hd1, .hero-deco .hd2 { left: 12px; } .hero-deco .hd3, .hero-deco .hd4 { right: 12px; } }
@media (max-width: 1180px) { .hero-deco { display: none; } }
@media (max-width: 640px) { .hero-stage { padding: 24px 14px 20px; border-radius: 18px; } .hero-modes button { font-size: 13px; } .hero-search-lg .btn { padding: 0 14px; } .hero-chips .hero-chip:nth-child(n+6) { display: none; } }

/* ---------- try-on: 8 placements wrap; cover-up before/after photos */
.seg.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.ba.ba-photo { aspect-ratio: 3 / 4; }
.ba.ba-photo > div > img { width: 100%; height: 100%; object-fit: cover; }
.cu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cu-ex { margin: 0; } .cu-ex figcaption { font-size: 13px; color: var(--fg-muted); margin-top: 8px; }
@media (max-width: 900px) { .cu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tryon-stage > img, .viewer-stage .body > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- design dialog (?design={id}) — the detail layout inside the viewer frame ---------- */
.viewer.d-modal { width: min(1080px, calc(100vw - 24px)); }
.d-modal .viewer-top { padding-left: 16px; }
.d-modal .dm-topic { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-modal .viewer-body { padding: 20px 24px 24px; }
.d-modal .detail { margin-top: 0; gap: 32px; }
.d-modal .detail-media { top: 0; }
.d-modal .detail-h1 { font-size: clamp(26px, 3vw, 36px); }
.d-modal .dm-meaning { margin: 0; }
@media (max-width: 640px) { .viewer.d-modal { width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 0; } .d-modal .viewer-body { padding: 14px 16px 20px; } .d-modal [data-dm-share] span { display: none; } }

/* ---------- directory ---------- */
.dir-filter { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: var(--r-full); background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--border); min-width: 280px; color: var(--fg-muted); }
.dir-filter input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 14px; color: var(--fg-strong); }
.feature-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.feature-strip .d-title { font-size: 12px; }
@media (max-width: 900px) { .feature-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dir-group { padding: 26px 0 30px; border-top: 1px solid var(--border); }
.dir-group .sec-title { margin-bottom: 18px; }
.az { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: 14px; }
.az a { color: var(--fg); }
.az a:hover { color: var(--accent); }
.az-letters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.az-letters a { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-elev); box-shadow: var(--shadow-sm); font-weight: 600; font-size: 13px; }
.az-block { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.az-block b { font-family: var(--font-serif); font-size: 26px; font-weight: 400; color: var(--accent); }
.az-block .az { margin-top: 4px; }

/* ---------- converters (stencil maker / photo to tattoo) + try-on ---------- */
.conv-stage, .tryon-stage { position: relative; aspect-ratio: 1; border-radius: var(--r-lg); background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--border); display: grid; place-items: center; overflow: hidden; }
.conv-stage canvas { max-width: 100%; max-height: 100%; }
.conv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--fg-muted); font-size: 13px; text-align: center; }
.conv-empty strong { color: var(--fg-strong); font-size: 15px; }
.conv-stage.is-drag { box-shadow: inset 0 0 0 2px var(--accent); }
.pick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pick-grid button .thumb { border-radius: 8px; }
.pick-grid button .thumb > svg { width: 78%; height: 78%; }
.pick-grid button.is-active .thumb { box-shadow: 0 0 0 2px var(--ink); }
.tryon-stage { aspect-ratio: 4 / 3; background: #E9E3DC; touch-action: none; }
.tryon-stage > svg, .tryon-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tryon-stage .overlay { position: absolute; left: 50%; top: 50%; aspect-ratio: 1; color: #221C17; --art-bg: transparent; cursor: grab; mix-blend-mode: multiply; }
.tryon-stage .overlay > svg, .tryon-stage .overlay > img { width: 100%; height: 100%; object-fit: contain; }
.tool-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tool-link { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: var(--r-md); background: var(--bg-elev); box-shadow: var(--shadow-sm); font-weight: 500; color: var(--fg-strong); }
.tool-link:hover { box-shadow: var(--shadow-md); }
.tool-link .i { color: var(--accent); }
@media (max-width: 860px) { .tool-links { grid-template-columns: 1fr 1fr; } }

/* ---------- search results ---------- */
.search-colls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.search-empty { padding: 48px 20px; text-align: center; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-sm); }

/* footer: 6 columns */
.footer-6 { grid-template-columns: 1.3fr repeat(5, 1fr); }
@media (max-width: 960px) { .footer-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .footer-6 { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 640px) { .tb-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); } .tb-filters::-webkit-scrollbar { display: none; } .tb-filters .chip { flex: none; } }

/* ---------- clean gallery restyle ---------- */
.home-hero { padding: 48px 0 40px; border-bottom: 1px solid var(--border); }
.hero-collage { background: var(--bg-sunken); box-shadow: none; }
.hero-h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.02; }
.coll-head { padding: 16px 0 0; }
.coll-title-row { margin-top: 10px; align-items: center; }
.coll-h1 { font-size: clamp(30px, 3.4vw, 42px); margin-top: 2px; }
.coll-lead { margin-top: 6px; font-size: 14.5px; max-width: 760px; }
.sub-tabs { margin-top: 14px; }
.sub-tab { height: 32px; padding: 0 12px; font-size: 13px; }
.lib-toolbar { margin-top: 10px; padding-top: 10px; flex-wrap: nowrap; }
.tb-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tb-filters::-webkit-scrollbar { display: none; }
.tb-filters .chip { flex: none; }
.tb-view { min-width: 0; flex: none; }
.masonry-grid { --grid-gap: 12px; }
@media (max-width: 640px) { .masonry-grid { --grid-gap: 10px; } }
.d-card .thumb { border-radius: 12px; }
.d-card:hover .thumb { box-shadow: none; transform: none; filter: brightness(.96); }
.d-title { font-size: 12.5px; font-weight: 500; padding-top: 6px; }
.coll-card, .trend, .s-card, .lib-card, .show-card, .steps3 > div, .price-duo > div, .license, .specs, .glance, .tool-link { box-shadow: 0 0 0 1px var(--border); }
.coll-card:hover, .trend:hover, .lib-card:hover, .tool-link:hover { box-shadow: 0 0 0 1px var(--border-strong); transform: none; }
.mosaic { gap: 2px; }
.gen-band { background: var(--bg-sunken); }
.tool-zone { background: var(--bg-sunken); border-bottom: 1px solid var(--border); }
.tool-zone .gen-card, .tool-zone .tool-card, .tool-zone .font-tool-input { box-shadow: 0 0 0 1px var(--border), 0 16px 40px -24px rgba(0,0,0,.25); }
@media (max-width: 640px) { .lib-toolbar { flex-wrap: wrap; } .tb-view { width: 100%; } }
.hero-collage { background: none; padding: 0; gap: 14px; }
@media (min-width: 861px) { .coll-title-row { flex-wrap: nowrap; } .coll-title-row > div:first-child { min-width: 0; } .coll-lead { max-width: 640px; } .coll-actions { flex: none; } }

/* ---------- real images (generated photos + design sheets) ---------- */
.thumb.has-img { background: var(--paper); }
.thumb.has-img > .ti { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.has-img > .ti-design { display: none; object-fit: contain; background: #FFFFFF; }
[data-view="paper"] .thumb.has-img > .ti-skin, [data-view="stencil"] .thumb.has-img > .ti-skin,
[data-v="paper"] .thumb.has-img > .ti-skin, [data-v="ink"] .thumb.has-img > .ti-skin, [data-v="stencil"] .thumb.has-img > .ti-skin { display: none; }
[data-view="paper"] .thumb.has-img > .ti-design, [data-view="stencil"] .thumb.has-img > .ti-design,
[data-v="paper"] .thumb.has-img > .ti-design, [data-v="ink"] .thumb.has-img > .ti-design, [data-v="stencil"] .thumb.has-img > .ti-design { display: block; }
[data-view="stencil"] .thumb.has-img > .ti-design, [data-v="stencil"] .thumb.has-img > .ti-design { filter: grayscale(1) contrast(1.6); }
.thumb.has-img > .ti-stencil { display: none; object-fit: contain; background: #FFFFFF; }
[data-view="stencil"] .thumb.has-stencil > .ti-design, [data-v="stencil"] .thumb.has-stencil > .ti-design { display: none; }
[data-view="stencil"] .thumb.has-stencil > .ti-stencil, [data-v="stencil"] .thumb.has-stencil > .ti-stencil { display: block; }
/* "On skin" view without a photo yet: show the neutral design card, not a fake skin gradient */
[data-view="photo"] .thumb.thumb:not(.has-img) { background: var(--paper); color: var(--paper-ink); --art-bg: var(--paper); }
[data-view="photo"] .thumb:not(.has-img) > svg { mix-blend-mode: normal; opacity: 1; }
.mosaic .thumb.has-img, .hero-collage .thumb.has-img, .trend .thumb.has-img { overflow: hidden; }

/* =========================================================
   Flow: browse → make it yours → try on & age → stencil
   Same tokens as the rest of the site (white canvas, ink, one red accent).
   ========================================================= */
/* hero generator */
.hero-gen { margin-top: 24px; max-width: 580px; padding: 14px 14px 12px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-md); }
.hero-gen textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px; line-height: 1.5; color: var(--fg-strong); padding: 4px 6px; min-height: 52px; }
.hero-gen textarea::placeholder { color: var(--fg-faint); }
.hero-gen-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.style-radios { display: flex; flex-wrap: wrap; gap: 6px; }
.style-radios label { position: relative; cursor: pointer; }
.style-radios input { position: absolute; opacity: 0; pointer-events: none; }
.style-radios label:has(input:checked) { background: var(--ink); color: var(--fg-on-ink); border-color: var(--ink); }
.style-radios label:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.hero-alt { margin-top: 14px; font-size: 14px; color: var(--fg-muted); }
.hero-visual { position: relative; }
.hero-ready { position: absolute; left: -14px; bottom: -10px; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: var(--r-md); background: var(--bg-elev); box-shadow: var(--shadow-md); }
.hero-ready b { display: block; font-size: 13px; color: var(--fg-strong); }
.hero-ready small { font-size: 12px; color: var(--fg-muted); }
@media (max-width: 900px) { .hero-ready { left: 8px; } }

/* 4-step strip */
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: none; }
.flow-step { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: 0 0 0 1px var(--border); }
.flow-step > .i { width: 26px; height: 26px; color: var(--accent); }
.flow-step h3 { font-size: 17px; font-weight: 600; color: var(--fg-strong); }
.flow-step p { font-size: 14px; color: var(--fg-muted); flex: 1; }
.flow-n { position: absolute; right: 18px; top: 16px; font: 500 12px var(--font-mono); color: var(--fg-faint); }
@media (max-width: 980px) { .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .flow-steps { grid-template-columns: 1fr; } }

/* why tattoo-ready */
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.why-card { padding: 16px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: 0 0 0 1px var(--border); display: flex; flex-direction: column; gap: 10px; }
.why-card h3 { font-size: 17px; font-weight: 600; color: var(--fg-strong); margin-top: 4px; }
.why-card p { font-size: 14px; color: var(--fg-muted); }
.why-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.why-pair figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.why-pair .thumb { border-radius: var(--r-md); }
.why-pair .thumb > svg { width: 74%; height: 74%; }
.why-pair figcaption { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; }
.why-pair figcaption.is-bad { color: var(--fg-muted); }
.why-pair figcaption.is-bad .i { color: var(--accent); }
.why-pair figcaption.is-ok { color: var(--ok); }
.thumb.bad-soft > svg { filter: blur(1.8px); opacity: .7; }
.thumb.bad-broken > svg * { stroke-dasharray: 7 3 2 5; }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } }

/* aging teaser */
.age-band { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 32px; border-radius: var(--r-xl); background: var(--bg-sunken); }
.age-demo { display: flex; flex-direction: column; gap: 12px; max-width: 440px; width: 100%; justify-self: center; }
.age-stage { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); display: grid; place-items: center; overflow: hidden; color: #2B2420; }
.age-target { width: 52%; aspect-ratio: 1; mix-blend-mode: multiply; transition: filter .35s var(--ease), opacity .35s var(--ease), color .35s var(--ease); }
.age-target > svg { width: 100%; height: 100%; }
.age-label { position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: var(--r-full); background: rgba(255, 255, 255, .92); color: #2B2B2E; font: 500 12px var(--font-sans); }
.age-seg button { height: 36px; }
@media (max-width: 860px) { .age-band { grid-template-columns: 1fr; padding: 22px; } }

/* stencil hand-off */
.handoff { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: center; }
.check-list { list-style: none; margin: 20px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.check-list li { display: flex; gap: 12px; font-size: 14px; color: var(--fg-muted); }
.check-list li .i { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.check-list b { display: block; color: var(--fg-strong); font-weight: 600; }
.handoff-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .handoff { grid-template-columns: 1fr; } .handoff-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }

/* pricing: three tiers */
.price-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1040px; margin: 0 auto; }
.price-card { position: relative; padding: 26px; border-radius: var(--r-xl); background: var(--bg-elev); box-shadow: 0 0 0 1px var(--border); display: flex; flex-direction: column; gap: 10px; }
.price-card.best { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-md); }
.price-card .badge { position: absolute; top: -11px; left: 24px; }
.price-card .amt { font-family: var(--font-serif); font-size: 44px; color: var(--fg-strong); line-height: 1; }
.price-card .amt small { font: 14px var(--font-sans); color: var(--fg-muted); }
.price-card ul { list-style: none; margin: 6px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; flex: 1; }
.price-card li { display: flex; gap: 8px; }
.price-card li .i { color: var(--ok); margin-top: 3px; flex: none; }
@media (max-width: 860px) { .price-trio { grid-template-columns: 1fr; max-width: 460px; } }

/* generator: folded options */
.gen-more { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.gen-more summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--fg-strong); cursor: pointer; padding: 4px 2px; }
.gen-more summary::-webkit-details-marker { display: none; }
.gen-more summary .faint { font-weight: 400; }
.gen-more[open] summary > .i:last-child { transform: rotate(180deg); }
.gen-more-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.gen-more-body .seg { min-width: 300px; }
.gen-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-muted); }
.gen-hint .i { color: var(--ok); }

/* tattoo-ready check */
.ready-badge { position: absolute; left: 8px; top: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: var(--r-full); font: 600 12px var(--font-sans); background: rgba(255, 255, 255, .94); color: var(--ok); box-shadow: 0 0 0 1px var(--border); }
.ready-badge.is-warn { color: var(--warn); }
.ready-badge.is-bad { color: var(--accent); }
.res { position: relative; }
.ready-card { padding: 14px; border-radius: var(--r-md); background: var(--bg-elev); box-shadow: 0 0 0 1px var(--border); }
.ready-top { display: flex; align-items: center; gap: 12px; }
.ready-score { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font: 500 20px var(--font-serif); color: #fff; background: var(--ok); }
.ready-card.is-warn .ready-score { background: var(--warn); }
.ready-card.is-bad .ready-score { background: var(--accent); }
.hero-ready .ready-score { background: var(--ok); }
.ready-txt { flex: 1; min-width: 0; }
.ready-txt strong { display: block; color: var(--fg-strong); font-size: 15px; }
.ready-txt small { color: var(--fg-muted); font-size: 12px; }
.ready-bar { height: 6px; margin-top: 12px; border-radius: var(--r-full); background: var(--bg-sunken); overflow: hidden; }
.ready-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .3s var(--ease); }
.ready-card.is-warn .ready-bar span { background: var(--warn); }
.ready-card.is-bad .ready-bar span { background: var(--accent); }
.ready-more { margin-top: 10px; }
.ready-more summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--fg-muted); cursor: pointer; }
.ready-more summary::-webkit-details-marker { display: none; }
.ready-more[open] summary .i { transform: rotate(180deg); }
.ready-more ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ready-more li { display: flex; gap: 8px; font-size: 13px; color: var(--fg-muted); }
.ready-more li .i { flex: none; margin-top: 2px; color: var(--ok); }
.ready-more li.warn .i { color: var(--warn); }
.ready-more li b { display: block; color: var(--fg-strong); font-weight: 600; }
.detail-ready { margin: 4px 0 2px; }

/* viewer: numbered steps + folded extras */
.step-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; border-radius: 12px; background: var(--bg-sunken); }
.step-tab { display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--fg-muted); white-space: nowrap; }
.step-tab b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; background: var(--bg-active); color: var(--fg-muted); }
.step-tab.is-active { background: var(--bg-elev); color: var(--fg-strong); box-shadow: var(--shadow-sm); }
.step-tab.is-active b { background: var(--accent); color: #fff; }
@media (max-width: 520px) { .step-tab { font-size: 12px; gap: 5px; } }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.viewer-actions .primary { margin-left: auto; }
.opt-more { border-radius: var(--r-sm); background: var(--bg-sunken); padding: 10px 12px; }
.opt-more summary { list-style: none; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--fg-strong); cursor: pointer; }
.opt-more summary::-webkit-details-marker { display: none; }
.opt-more[open] { display: flex; flex-direction: column; gap: 10px; }
.opt-more .opt { margin-top: 4px; }
.switch-row { flex-direction: row !important; align-items: center; justify-content: space-between; }
.brief { font-size: 13px; color: var(--fg); background: var(--bg-elev); border-radius: 8px; padding: 10px 12px; box-shadow: 0 0 0 1px var(--border); }
.est { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.est > div { padding: 10px 12px; border-radius: 8px; background: var(--bg-elev); box-shadow: 0 0 0 1px var(--border); }
.est small { display: block; font-size: 12px; color: var(--fg-muted); }
.est b { font: 500 20px var(--font-serif); color: var(--fg-strong); }
.est label { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.est input { width: 110px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg-elev); }
.age-note { font-size: 13px; color: var(--fg); margin-top: 8px; }
.age-note .link { font-size: 13px; font-weight: 600; }
.viewer-stage .sheet { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.viewer-stage .sheet > svg { height: auto; aspect-ratio: 1; }
.ruler { display: flex; align-items: center; gap: 6px; font: 9px var(--font-mono); color: #6E6A62; }
.ruler span { flex: 1; border-top: 1px solid #6E6A62; }
.cm-check { display: inline-flex; align-items: center; gap: 4px; }
.cm-check i { display: inline-block; border: 1px solid #111; }
.skin-row { display: flex; gap: 8px; flex-wrap: wrap; }
.skin-dot { width: 30px; height: 30px; border-radius: 50%; background: #D4A585; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.skin-dot.is-active { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt-sub { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.tryon-stage .tag-tr { position: absolute; right: 10px; top: 10px; background: rgba(255,255,255,.92); color: #2B2B2E; }
.tryon-stage .overlay, .viewer-stage .overlay { transition: filter .35s var(--ease), opacity .35s var(--ease), color .35s var(--ease); }

/* paid features */
.lock-tag { display: inline-grid; place-items: center; margin-left: 2px; color: var(--accent); }
.lock-tag .i { width: 13px; height: 13px; }
/* The offer dialog (paid plan, sign in, a price to confirm): an ink header, a calm white body. Ink is the brand
   colour here; red is a single small mark. */
.paywall { width: min(540px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 26px; overflow: hidden; background: var(--bg-elev); color: var(--fg); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .06); text-align: left; }
.paywall[open] { animation: pw-in .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes pw-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.paywall::backdrop { background: rgba(8, 8, 10, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.paywall .pw-x { position: absolute; right: 14px; top: 14px; z-index: 1; color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .08); border-radius: 50%; }
.paywall .pw-x:hover { color: #fff; background: rgba(255, 255, 255, .16); }
.pw-head { position: relative; padding: 34px 34px 28px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #2a2a2e 0%, #131315 46%, #0b0b0c 100%); }
.pw-head::after { content: ""; position: absolute; left: 34px; right: 34px; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0)); }
.pw-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.pw-eyebrow { display: flex; align-items: center; gap: 8px; margin-top: 18px; font: 600 11px/1 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
.pw-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pw-title { margin-top: 10px; font: 400 32px/1.08 var(--font-serif); letter-spacing: -.01em; color: #fff; }
.pw-sub { margin: 10px 0 0; max-width: 420px; font-size: 14.5px; line-height: 1.5; color: rgba(255, 255, 255, .72); }
.pw-body { padding: 22px 26px 22px; }
.pw-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; margin: 2px 8px 20px; padding: 0; list-style: none; font-size: 13.5px; color: var(--fg); }
.pw-list li { display: flex; align-items: flex-start; gap: 8px; }
.pw-list .i { flex: none; margin-top: 2px; color: var(--ink); }
.pw-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pw-opts:has(> :only-child) { grid-template-columns: 1fr; }
.pw-opt { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; border: 0; border-radius: 18px; background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--border-strong, rgba(0, 0, 0, .16)); text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.pw-opt:hover { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-1px); }
.pw-opt strong { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--fg-strong); }
.pw-opt b { font: 400 30px/1.05 var(--font-serif); color: var(--fg-strong); }
.pw-opt b small { font: 12.5px var(--font-sans); color: var(--fg-muted); }
.pw-opt span { font-size: 12.5px; line-height: 1.45; color: var(--fg-muted); }
.pw-opt.is-best { background: var(--ink); box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .6); }
.pw-opt.is-best:hover { background: var(--ink-hover); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .65); }
.pw-opt.is-best strong, .pw-opt.is-best b { color: #fff; }
.pw-opt.is-best b small, .pw-opt.is-best span { color: rgba(255, 255, 255, .7); }
.pw-opt .pw-tag { margin-left: auto; padding: 3px 8px; border-radius: 999px; font: 600 10px/1.2 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(255, 255, 255, .14); }
.pw-later { display: block; margin: 14px auto 0; padding: 8px 14px; border: 0; background: none; font: 500 13px var(--font-sans); color: var(--fg-muted); cursor: pointer; border-radius: 999px; }
.pw-later:hover { color: var(--fg-strong); background: var(--bg-sunken, rgba(0, 0, 0, .04)); }
.pw-note { margin: 14px 8px 0; font-size: 12px; line-height: 1.5; color: var(--fg-muted); text-align: center; }
@media (max-width: 480px) { .pw-opts, .pw-list { grid-template-columns: 1fr; } .pw-head { padding: 28px 24px 24px; } .pw-head::after { left: 24px; right: 24px; } .pw-body { padding: 18px 16px; } .pw-title { font-size: 27px; } }
.viewer-body > * { flex-shrink: 0; }
.viewer-stage { max-height: 52vh; width: 100%; }
.viewer-stage .sheet { height: 92%; max-height: calc(52vh - 20px); }

/* ---------- topic page: refine by what people search for (placement / ideas / color / style / who) ---------- */
.refine { margin-top: 14px; }
.refine-tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.refine-tabs::-webkit-scrollbar { display: none; }
.refine-tab { flex: none; height: 36px; padding: 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 13.5px; font-weight: 600; color: var(--fg-muted); }
.refine-tab:first-child { padding-left: 2px; }
.refine-tab:hover { color: var(--fg-strong); }
.refine-tab.is-active { color: var(--fg-strong); border-bottom-color: var(--fg-strong); }
.refine-key { flex: none; margin-left: auto; padding-left: 16px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--fg-muted); }
.refine-key .i { width: 12px; height: 12px; color: var(--accent); }
.refine-row { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; max-height: 34px; overflow: hidden; padding-right: 84px; }
.refine-row.is-open { max-height: none; }
.r-more { position: absolute; right: 0; top: 0; height: 34px; padding: 0 6px 0 18px; display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--fg-strong);
  background: linear-gradient(90deg, transparent, var(--bg) 16px); }
.r-more .i { width: 14px; height: 14px; transition: transform .15s; }
.refine-row.is-open .r-more { position: static; background: none; padding-left: 6px; }
.refine-row.is-open .r-more .i { transform: rotate(180deg); }
.r-chip small { font-size: 11.5px; font-weight: 500; color: var(--fg-muted); }
.r-chip.is-active small { color: inherit; opacity: .7; }
.refine-foot { margin-top: 12px; padding-top: 10px; }
.tb-count { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--fg-muted); }
.tb-count [data-count] { font-weight: 600; color: var(--fg-strong); }
.tb-clear { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: var(--r-full); background: var(--bg-sunken); font-size: 12.5px; font-weight: 500; color: var(--fg-strong); }
.tb-clear .i { width: 12px; height: 12px; }
.r-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r-full); background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--border); font-size: 13px; font-weight: 500; color: var(--fg-strong); white-space: nowrap; transition: box-shadow .15s, background .15s; }
.r-chip:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.r-chip.has-thumb { padding-left: 3px; }
.r-chip .thumb { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; overflow: hidden; }
.r-chip .thumb > svg { width: 80%; height: 80%; }
.r-chip.is-active { background: var(--ink); color: var(--fg-on-ink); box-shadow: none; }
.r-chip.r-create { background: transparent; color: var(--fg); box-shadow: none; border: 1px dashed var(--border-strong); padding: 0 12px 0 10px; }
.r-chip.r-create:hover { background: var(--bg-elev); color: var(--fg-strong); }
.r-chip.r-create .i { width: 13px; height: 13px; color: var(--accent); }
.lib-toolbar { scroll-margin-top: 84px; }
@media (max-width: 640px) {
  .refine-key { display: none; }
  .refine-row, .refine-row.is-open { flex-wrap: nowrap; max-height: none; overflow-x: auto; scrollbar-width: none; margin: 12px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 2px; }
  .r-more { display: none; }
  .refine-row::-webkit-scrollbar { display: none; }
  .r-chip { flex: none; }
}

/* ---------- topic page: placement guide ---------- */
.pg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pg-card { display: flex; flex-direction: column; width: 100%; text-align: left; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .2s, transform .2s var(--ease); }
.pg-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pg-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-sunken); }
.pg-body { display: grid; gap: 6px; padding: 12px 14px 16px; }
.pg-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 600; color: var(--fg-strong); }
.pg-n { font-size: 12px; font-weight: 500; color: var(--fg-muted); }
.pg-n::after { content: " designs"; }
.pg-facts { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--fg-muted); }
.pg-pain { display: inline-flex; align-items: center; gap: 6px; }
.pg-pain .dots { display: inline-flex; gap: 2px; }
.pg-pain .dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--bg-active); }
.pg-pain .dots i.on { background: var(--accent); }
.pg-note { font-size: 13px; line-height: 1.45; color: var(--fg); }
@media (max-width: 1000px) { .pg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .pg-note { display: none; } .pg-facts { flex-wrap: wrap; gap: 4px 10px; } }

/* ---------- topic page: what different versions mean ---------- */
.prose .var-list { list-style: none; padding: 0; margin: 12px 0 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 680px) { .prose .var-list { grid-template-columns: 1fr; } }
.prose .var-list li { margin: 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--bg-elev); box-shadow: var(--shadow-sm); font-size: 14.5px; line-height: 1.45; }
.prose .var-list li::before { content: none; }
.prose .var-list b a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ---------- design whose photo is still being generated ---------- */
.thumb.thumb-pending { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; text-align: center; background: var(--bg-sunken); color: var(--fg-muted); }
.thumb-pending span { font-family: var(--font-serif); font-size: 20px; line-height: 1.15; color: var(--fg-strong); }
.thumb-pending small { font-size: 11.5px; }
.mosaic .thumb-pending span, .r-chip .thumb-pending span, .hero-chip .thumb-pending span { font-size: 12px; }
.mosaic .thumb-pending small, .r-chip .thumb-pending small, .hero-chip .thumb-pending small, .r-chip .thumb-pending span, .hero-chip .thumb-pending span { display: none; }

/* ---- topic page modules (ideas, men & women, small, styles, stencils, skin tones, name, tools) ---- */
.d-card .d-place { position: absolute; top: 8px; left: 8px; z-index: 2; height: 22px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; color: #fff; background: rgba(20, 18, 16, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
[data-view="paper"] .d-card .d-place, [data-view="stencil"] .d-card .d-place { color: var(--fg-strong); background: rgba(255, 255, 255, .85); box-shadow: inset 0 0 0 1px var(--border); }
.pt-list li b { color: var(--fg-strong); }
.pg-more { margin-top: 22px; max-width: none; }
.pg-more h3 { margin-top: 20px; }
.idea-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; counter-reset: none; }
.idea { position: relative; padding: 18px 20px 16px 62px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.idea-n { position: absolute; left: 20px; top: 17px; font-family: var(--font-serif); font-size: 24px; line-height: 1; color: var(--fg-faint); }
.idea h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--fg-strong); }
.idea p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; color: var(--fg); }
.idea .link-arrow { font-size: 13.5px; }
.mw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mw-col { padding: 14px 14px 20px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.mw-col h3 { margin: 16px 6px 8px; font-size: 18px; font-weight: 600; color: var(--fg-strong); }
.mw-col p { margin: 0 6px 12px; font-size: 15px; line-height: 1.7; }
.mw-col .link-arrow { margin: 0 6px; font-size: 14px; }
.mw-thumbs, .sm-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sm-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mw-th { display: block; }
.mw-th .thumb { aspect-ratio: 1; border-radius: var(--r-md); }
.split-mod { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: center; }
.split-mod > .prose:only-child { grid-column: 1 / -1; max-width: 760px; }
.st-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.st-card { display: flex; gap: 14px; padding: 10px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.st-card .mw-th { flex: none; width: 92px; }
.st-body { min-width: 0; padding: 4px 4px 4px 0; }
.st-body h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--fg-strong); }
.st-body h3 a { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.st-body p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--fg); }
.draw-how { margin-top: 26px; max-width: 760px; }
.draw-how h3 { margin-top: 0; }
.tone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tone-grid figure { margin: 0; }
.tone-grid figcaption { padding-top: 6px; font-size: 12.5px; color: var(--fg-muted); text-align: center; }
.tool-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.tool-strip a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--border); }
.tool-strip a:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.tool-strip .i { flex: none; width: 18px; height: 18px; color: var(--accent); }
.tool-strip b { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg-strong); }
.tool-strip small { display: block; font-size: 12px; color: var(--fg-muted); line-height: 1.35; }
.coll-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 2px 6px 6px; font-size: 12.5px; line-height: 1.45; color: var(--fg); }
@media (max-width: 1000px) { .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tool-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .idea-grid, .mw-grid, .st-grid, .split-mod { grid-template-columns: 1fr; }
  .split-mod { gap: 18px; }
  .tool-strip { grid-template-columns: 1fr 1fr; }
  .idea { padding: 16px 16px 14px 52px; } .idea-n { left: 16px; }
}
