:root {
  --red: #E4322B; --red-d: #B8231D;
  --yellow: #FFC72C; --yellow-d: #E0A400;
  --blue: #1567D3; --blue-d: #0E4FA6;
  --green: #1FA35C; --green-d: #167A44;
  --orange: #FF7A1A; --orange-d: #D55E05;
  --ink: #1B1D29; --ink-2: #4A4E63; --muted: #7C8096;
  --bg: #FFF8EC; --bg-2: #F6EDDA; --card: #FFFFFF; --line: #EFE3CC;
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 10px;
  --shadow: 0 1px 0 rgba(27,29,41,.04), 0 10px 28px -14px rgba(27,29,41,.22);
  --shadow-up: 0 2px 0 rgba(27,29,41,.05), 0 22px 44px -18px rgba(27,29,41,.32);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: clamp(16px, 4vw, 40px);
  --tabbar: 0px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 150px; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  background-image: radial-gradient(rgba(27,29,41,.045) 1.6px, transparent 1.7px);
  background-size: 22px 22px; min-height: 100vh; display: flex; flex-direction: column;
  padding-bottom: var(--tabbar);
}
a { color: var(--blue); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
.muted { color: var(--muted); }
.strong { font-weight: 750; }
.sub { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
[hidden] { display: none !important; }
.link { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 750; cursor: pointer; font-size: 13px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; gap: 18px; align-items: center;
  padding: max(12px, env(safe-area-inset-top)) var(--pad) 12px;
  background: rgba(255, 248, 236, .86); backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo-word { font-weight: 850; font-size: 22px; letter-spacing: -.02em; }
.logo-word b { color: var(--red); }
.search {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: 999px; padding: 0 18px; height: 48px; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: border-color .2s var(--ease);
}
.search:focus-within { border-color: var(--yellow); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); min-width: 0; }
.search.big { max-width: 720px; height: 60px; margin: 10px 0 40px; }
.search.big input { font-size: 19px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { position: relative; text-decoration: none; color: var(--ink-2); font-weight: 800; font-size: 15px; padding: 10px 14px; border-radius: 999px; transition: background .15s; }
.nav a:hover { background: var(--bg-2); }
.nav a.on { background: var(--ink); color: #fff; }
.badge { position: absolute; top: -6px; right: -10px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

.tabbar { display: none; }

main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 26px var(--pad) 60px; outline: none; }

/* ---------- banner ---------- */
.banner { max-width: 1280px; margin: 18px auto 0; width: calc(100% - 2 * var(--pad)); background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 16px 20px; display: grid; gap: 10px; }
.banner strong { font-weight: 850; }
.banner .sub { color: #C9CCDA; font-size: 13px; margin: 0; }
.banner.error { background: var(--red); }
.bar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.bar > span {
  display: block; height: 100%; width: 0; border-radius: 99px; transition: width .4s var(--ease);
  background: repeating-linear-gradient(90deg, var(--red) 0 25%, var(--yellow) 25% 50%, var(--blue) 50% 75%, var(--green) 75% 100%);
  background-size: 160px 100%; animation: march 2.4s linear infinite;
}
.bar.indet > span { width: 40%; animation: march 2.4s linear infinite, slide 1.6s var(--ease) infinite alternate; }
@keyframes march { to { background-position: 160px 0; } }
@keyframes slide { from { margin-left: 0; } to { margin-left: 60%; } }
.bar.light { background: #F3EBDB; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; align-items: center; padding: 10px 0 30px; }
.hero h1 { font-size: clamp(40px, 6.2vw, 72px); line-height: .96; letter-spacing: -.04em; margin: 8px 0 18px; font-weight: 900; }
.hero h1 .hl { color: var(--red); }
.hero .lead { font-size: 19px; line-height: 1.5; color: var(--ink-2); margin: 0 0 24px; max-width: 34ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.hero-stats b { color: var(--ink); font-size: 20px; font-weight: 900; margin-right: 4px; }

/* ---------- headings ---------- */
.page-head { margin: 8px 0 22px; }
.page-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(32px, 4.6vw, 48px); letter-spacing: -.035em; font-weight: 900; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 40px 0 16px; }
.section-head h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; font-weight: 880; }
.see-all { font-weight: 800; text-decoration: none; color: var(--ink); background: var(--card); padding: 9px 16px; border-radius: 999px; box-shadow: var(--shadow); font-size: 14px; white-space: nowrap; }
.see-all:hover { background: var(--yellow); }

/* ---------- shelves (horizontal rails) ---------- */
.shelf-nav { display: flex; gap: 8px; align-items: center; }
.arrow { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 22px; font-weight: 800; cursor: pointer; line-height: 1; }
.arrow:hover { background: var(--yellow); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); padding: 6px var(--pad) 18px; margin: 0 calc(-1 * var(--pad)); scrollbar-width: none; overscroll-behavior-x: contain; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail.themes { grid-auto-columns: 280px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card {
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; text-decoration: none;
  color: inherit; display: flex; flex-direction: column; min-width: 0;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-up); outline: none; }
.card .pic { aspect-ratio: 4 / 3; background: #fff; position: relative; overflow: hidden; display: grid; place-items: center; }
.card .pic img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; transition: transform .4s var(--ease); }
.card:hover .pic img { transform: scale(1.05); }
.card.fig .pic { aspect-ratio: 1; background: radial-gradient(90% 80% at 50% 30%, #fff 0, #F7F1E4 100%); }
.ph { width: 64%; aspect-ratio: 1; background: url(/img/ph.png) center / contain no-repeat; opacity: .55; }
.ph.big { width: 40%; }
.card .body { padding: 13px 16px 16px; border-top: 4px solid var(--accent, var(--yellow)); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .num { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .03em; }
.card .name { font-weight: 820; font-size: 16px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.pct { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 900; padding: 4px 9px; border-radius: 99px; color: #fff; background: var(--ink); }
.pct.good { background: var(--green); } .pct.ok { background: var(--orange); } .pct.low { background: var(--red); }

.theme-tile {
  position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--card); box-shadow: var(--shadow);
  text-decoration: none; color: inherit; display: flex; flex-direction: column; min-width: 0; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.theme-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-up); }
.theme-tile .tpic { aspect-ratio: 16 / 10; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, #fff), #fff 70%); position: relative; }
.theme-tile .tpic img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0,0,0,.14)); }
.theme-tile .tbody { padding: 12px 16px 15px; display: grid; gap: 2px; border-top: 4px solid var(--accent); }
.theme-tile .tname { font-weight: 880; font-size: 18px; letter-spacing: -.01em; }
.theme-tile .tmeta { font-size: 13px; color: var(--muted); font-weight: 700; }
.theme-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* ---------- decades + pick a brick ---------- */
.decade-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.decade { text-decoration: none; color: #fff; background: var(--accent); border-radius: var(--r-md); padding: 16px 16px 14px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); display: grid; gap: 2px; transition: transform .2s var(--ease); }
.decade:hover { transform: translateY(-3px) rotate(-1deg); }
.decade b { font-size: 30px; font-weight: 900; letter-spacing: -.03em; }
.decade span { font-size: 13px; font-weight: 750; opacity: .92; }
.decade[style*="--yellow"] { color: var(--ink); }
.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cat { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 12px 12px 14px; text-decoration: none; color: var(--ink); display: grid; gap: 4px; border-bottom: 4px solid var(--accent); transition: transform .2s var(--ease); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.cat:hover { transform: translateY(-3px); }
.cat .cpic { aspect-ratio: 1.4; background: #FAF6EE; border-radius: var(--r-sm); position: relative; }
.cat .cpic img { position: absolute; inset: 10%; width: 80%; height: 80%; object-fit: contain; mix-blend-mode: multiply; }
.cat b { font-size: 14px; font-weight: 850; line-height: 1.2; margin-top: 4px; }
.cat span { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ---------- browse filters ---------- */
.filters { display: grid; gap: 12px; margin-bottom: 16px; position: sticky; top: 72px; z-index: 10; background: rgba(255, 248, 236, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); margin-inline: calc(-1 * var(--pad)); padding: 12px var(--pad); border-bottom: 1px solid var(--line); }
.tabs { display: inline-flex; background: #F0E6D2; border-radius: 999px; padding: 4px; gap: 4px; justify-self: start; }
.tabs button { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; font-weight: 820; cursor: pointer; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.frow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.frow.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); }
.frow.scroll::-webkit-scrollbar { display: none; }
.fchip { flex: none; border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-weight: 780; font-size: 14px; cursor: pointer; color: var(--ink); text-decoration: none; transition: all .15s var(--ease); white-space: nowrap; }
.fchip small { color: var(--muted); font-weight: 700; margin-left: 2px; }
.fchip:hover { border-color: var(--ink-2); }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip.on small { color: #C9CCDA; }
.fsep { width: 1px; height: 24px; background: var(--line); flex: none; margin: 0 4px; }
.cdot { flex: none; border: 0; background: none; padding: 3px; border-radius: 50%; cursor: pointer; }
.cdot .sw { width: 30px; height: 30px; display: block; }
.cdot.on { box-shadow: 0 0 0 3px var(--ink); }
.select { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 14px; font-weight: 780; font-size: 14px; }
.select span { color: var(--muted); }
.select select { border: 0; background: transparent; font: inherit; font-weight: 820; color: var(--ink); padding: 4px 6px; outline: none; max-width: 220px; cursor: pointer; }
.result-line { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 14px; font-weight: 750; min-height: 40px; }
.more { min-height: 60px; display: grid; place-items: center; }
.end { margin: 26px 0 0; font-weight: 700; }

/* ---------- theme page ---------- */
.theme-hero { position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--ink); color: #fff; min-height: 240px; display: flex; align-items: flex-end; margin-bottom: 18px; box-shadow: var(--shadow-up); }
.th-bg { position: absolute; inset: 0; background: radial-gradient(100% 120% at 80% 30%, #3A3F5C 0, var(--ink) 70%); }
.th-bg img { position: absolute; right: 4%; top: 8%; height: 84%; width: 52%; object-fit: contain; filter: drop-shadow(0 20px 30px rgba(0,0,0,.4)); }
.th-text { position: relative; padding: 28px 32px; max-width: 60%; }
.th-text h1 { margin: 6px 0 6px; font-size: clamp(34px, 5vw, 56px); letter-spacing: -.035em; font-weight: 900; line-height: 1; }
.th-text .sub { color: #C9CCDA; font-weight: 700; }
.crumbs { margin: 0; font-size: 13px; font-weight: 800; color: var(--yellow); }
.crumbs a { color: var(--yellow); text-decoration: none; }
.subthemes { margin-bottom: 6px; padding-block: 4px; }

/* ---------- set page ---------- */
.set-hero { display: grid; grid-template-columns: minmax(260px, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
.set-hero > * { min-width: 0; }
.set-pic { background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow); display: grid; place-items: center; padding: 22px; min-height: 300px; position: sticky; top: 90px; }
.set-pic img { max-height: 380px; object-fit: contain; }
.is-fig .set-pic { background: radial-gradient(90% 80% at 50% 30%, #fff 0, #F7F1E4 100%); }
.set-info h1 { margin: 6px 0 8px; font-size: clamp(30px, 4.4vw, 48px); line-height: 1.02; letter-spacing: -.035em; font-weight: 900; }
.eyebrow { margin: 0; font-weight: 850; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.eyebrow a { color: inherit; text-decoration: none; border-bottom: 2px solid color-mix(in srgb, var(--red) 30%, transparent); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.stat { border-radius: var(--r-md); padding: 14px 16px; color: #fff; box-shadow: inset 0 -6px 0 rgba(0,0,0,.14); min-width: 0; }
.stat b { display: block; font-size: 30px; font-weight: 900; letter-spacing: -.03em; }
.stat span { font-size: 13px; font-weight: 750; opacity: .94; }
.stat.s1 { background: var(--red); } .stat.s2 { background: var(--blue); } .stat.s3 { background: var(--green); }
.printbox { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; align-content: start; }
.printbox h3 { margin: 0; font-size: 20px; font-weight: 880; }
.printbox.sticky { position: sticky; top: 90px; }
.color-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-all { font-size: 13px; color: var(--muted); margin-top: -6px; }
.cpick { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px 5px 5px; font-size: 13px; font-weight: 750; cursor: pointer; transition: all .15s var(--ease); }
.cpick[aria-pressed="false"] { opacity: .45; }
.cpick[aria-pressed="true"] { border-color: var(--ink); }
.sw { width: 22px; height: 22px; border-radius: 50%; flex: none; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), inset 0 -3px 0 rgba(0,0,0,.12); }
.sw.trans, .swatches .trans { background-image: linear-gradient(135deg, rgba(255,255,255,.7) 0 32%, transparent 32%) !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer; text-decoration: none; font-weight: 850; font-size: 16px; padding: 14px 22px; border-radius: 999px; background: var(--yellow); color: var(--ink); box-shadow: inset 0 -4px 0 var(--yellow-d); transition: transform .15s var(--ease), filter .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.04); } .btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--yellow-d); }
.btn.blue { background: var(--blue); color: #fff; box-shadow: inset 0 -4px 0 var(--blue-d); }
.btn.ghost { background: #F0E6D2; box-shadow: none; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row.center { justify-content: center; }
.btn-row.split > * { flex: 1; }
.job { display: grid; gap: 10px; }
.job .step { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.tip { font-size: 13px; color: var(--ink-2); line-height: 1.5; background: #FFF3D1; border-radius: var(--r-sm); padding: 10px 12px; margin: 0; }
.tip b { color: var(--ink); }

.jumpbar { position: sticky; top: 72px; z-index: 9; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 34px calc(-1 * var(--pad)) 0; padding: 10px var(--pad); background: rgba(255, 248, 236, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); align-items: center; }
.jumpbar::-webkit-scrollbar { display: none; }
.jumpbar a { flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); background: var(--card); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 13px; font-weight: 780; box-shadow: var(--shadow); }
.jumpbar a small { color: var(--muted); font-weight: 750; }
.toggle { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; padding-left: 10px; cursor: pointer; white-space: nowrap; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }
.hide-off .ptile.off { display: none; }

.color-group { margin-top: 30px; }
.cg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cg-head .sw { width: 36px; height: 36px; }
.cg-head h3 { margin: 0; font-size: 22px; font-weight: 880; letter-spacing: -.015em; }
.parts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ptile { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 10px 10px 12px; border: 0; cursor: pointer; text-align: left; display: grid; gap: 6px; align-content: start; position: relative; min-width: 0; transition: transform .2s var(--ease), box-shadow .2s var(--ease); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.ptile:hover, .ptile:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-up); outline: none; }
.ptile .pimg { aspect-ratio: 1; background: #FAF6EE; border-radius: var(--r-sm); display: grid; place-items: center; overflow: hidden; }
.ptile .pimg img { width: 82%; height: 82%; object-fit: contain; mix-blend-mode: multiply; }
.ptile .pimg .ph { width: 70%; background-color: transparent !important; }
.ptile .qty { position: absolute; top: 6px; right: 6px; background: var(--ink); color: #fff; font-weight: 900; font-size: 13px; padding: 4px 9px; border-radius: 999px; }
.ptile .pname { font-size: 13px; font-weight: 760; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ptile .pnum { font-size: 12px; color: var(--muted); font-weight: 700; }
.ptile.off { opacity: .62; }
.ptile.off .pimg { filter: grayscale(.7); }
.flags { display: flex; flex-wrap: wrap; gap: 5px; }
.flag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: #FFF3D1; color: #7A5600; }
.flag.block { background: #FDE2E0; color: var(--red-d); }
.flag.info { background: #E3EEFC; color: var(--blue-d); }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.empty .big { font-size: 24px; font-weight: 880; color: var(--ink); margin-bottom: 8px; }
.empty p { line-height: 1.55; }

/* ---------- bag ---------- */
.bag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.bag-group { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px 8px; margin-bottom: 16px; }
.bag-group .cg-head { margin-bottom: 8px; }
.bag-group .cg-head h3 { font-size: 18px; }
.bag-group .cg-head .sw { width: 26px; height: 26px; }
.bag-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 36px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.bimg { width: 56px; height: 56px; border-radius: 12px; background: #FAF6EE; display: grid; place-items: center; overflow: hidden; }
.bimg img { width: 80%; height: 80%; object-fit: contain; mix-blend-mode: multiply; }
.bimg .ph { width: 60%; }
.binfo { display: grid; gap: 2px; min-width: 0; }
.binfo b { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binfo span { font-size: 12px; font-weight: 700; }
.stepper { display: inline-flex; align-items: center; background: #F0E6D2; border-radius: 999px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--card); font-weight: 900; font-size: 18px; cursor: pointer; line-height: 1; }
.stepper input { width: 46px; border: 0; background: transparent; text-align: center; font: inherit; font-weight: 850; font-size: 15px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.remove { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; font-size: 22px; color: var(--muted); cursor: pointer; }
.remove:hover { background: #FDE2E0; color: var(--red-d); }

/* ---------- part sheet ---------- */
dialog.sheet { border: 0; padding: 0; border-radius: var(--r-xl); width: min(900px, calc(100% - 24px)); max-height: calc(100% - 24px); background: var(--card); color: var(--ink); box-shadow: 0 40px 80px -20px rgba(27,29,41,.45); }
dialog.sheet::backdrop { background: rgba(27, 29, 41, .45); backdrop-filter: blur(4px); }
dialog.sheet[open] { animation: pop .3s var(--ease); }
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.sheet-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 460px; position: relative; }
.sheet-inner > * { min-width: 0; }
.close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #F0E6D2; font-size: 24px; line-height: 1; cursor: pointer; }
.stage { position: relative; background: radial-gradient(120% 90% at 50% 20%, #FFFFFF 0%, #F6EEDD 70%, #EFE3CB 100%); min-height: 360px; touch-action: none; }
.stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 700; padding: 20px; text-align: center; }
.pd-body { padding: 26px 24px 24px; display: grid; gap: 12px; align-content: start; overflow-y: auto; max-height: calc(100vh - 40px); }
.pd-body h2 { margin: 0; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; font-weight: 900; padding-right: 36px; }
.pd-body p { margin: 0; }
.pd-body .note { flex-basis: 100%; font-size: 13px; margin-top: 4px; line-height: 1.45; }
.label { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 0 0 8px !important; }
.label b { color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; cursor: pointer; box-shadow: 0 0 0 2px var(--line); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.actions { display: grid; gap: 10px; margin-top: 4px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--tabbar)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 750; font-size: 14px; z-index: 100; transition: all .3s var(--ease); box-shadow: var(--shadow-up); max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: var(--yellow); margin-left: 6px; }

/* ---------- footer ---------- */
.foot { padding: 26px var(--pad) 26px; font-size: 13px; color: var(--ink-2); text-align: center; border-top: 1px solid var(--line); }
.foot p { margin: 4px auto; max-width: 820px; line-height: 1.5; }
.foot button { border: 0; background: none; color: var(--blue); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }

.skeleton { background: linear-gradient(90deg, #F3EBDB 0%, #FBF6EC 50%, #F3EBDB 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .nav { display: none; }
  :root { --tabbar: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: var(--tabbar); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-top: 1px solid var(--line);
  }
  .tabbar a { position: relative; display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 800; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .tabbar a.on { color: var(--red); }
  .tabbar .badge { top: 6px; right: calc(50% - 22px); }
  .bag-layout { grid-template-columns: minmax(0, 1fr); }
  .printbox.sticky { position: static; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .set-hero { grid-template-columns: minmax(0, 1fr); }
  .set-pic { position: static; min-height: 220px; }
  .sheet-inner { grid-template-columns: minmax(0, 1fr); }
  .stage { min-height: 290px; }
  .pd-body { max-height: none; }
  .th-text { max-width: 100%; padding: 22px; }
  .th-bg img { opacity: .35; width: 80%; right: -10%; }
  .filters { top: 64px; }
  .jumpbar { top: 64px; }
}
@media (max-width: 560px) {
  .top { gap: 10px; padding-bottom: 10px; }
  .logo-word { display: none; }
  .search { height: 44px; padding: 0 14px; }
  .section-head { margin-top: 30px; }
  .section-head h2 { font-size: 22px; }
  .arrow { display: none; }
  .rail { grid-auto-columns: 168px; gap: 12px; }
  .rail.themes { grid-auto-columns: 230px; }
  .stats { gap: 8px; } .stat b { font-size: 22px; } .stat { padding: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .theme-tile .tname { font-size: 15px; }
  .parts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .ptile .pname { font-size: 12px; }
  .card .name { font-size: 14px; }
  .card .body { padding: 10px 12px 12px; }
  .decade b { font-size: 24px; }
  .bag-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .bag-row .remove { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; margin-top: -6px; }
  .bag-row .stepper { grid-column: 2 / 4; justify-self: start; }
  dialog.sheet { width: 100%; max-width: 100%; max-height: 92%; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .toggle { margin-left: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- print plan (after "Make print files") ---------- */
#print-results { margin-top: 34px; scroll-margin-top: 90px; animation: rise .4s var(--ease) both; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.plan-head h2 { margin: 6px 0 4px; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.03em; font-weight: 900; line-height: 1.1; }
.plan-head .sub b { color: var(--ink); }
.howto { counter-reset: step; list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.howto li { counter-increment: step; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 14px 16px 14px 54px; position: relative; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.howto li::before { content: counter(step); position: absolute; left: 14px; top: 13px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--red); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.howto li:nth-child(2)::before { background: var(--blue); } .howto li:nth-child(3)::before { background: var(--green); }
.howto b { color: var(--ink); }
.howto code { font-size: 12px; background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }
.buy { margin-top: 14px; background: #FDE2E0; border-radius: var(--r-md); padding: 12px 16px; font-size: 14px; color: var(--red-d); }
.buy summary { cursor: pointer; }
.buy ul { margin: 10px 0 2px; padding-left: 18px; color: var(--ink-2); line-height: 1.5; }
.plan-color { margin-top: 28px; }
.plan-color .cg-head .sw { width: 30px; height: 30px; }
.plate-cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.plate-card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.pc-num { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-weight: 900; font-size: 13px; padding: 4px 10px; border-radius: 99px; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.pc-body { padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; flex: 1; }
.pc-title { display: flex; align-items: center; gap: 4px 8px; min-width: 0; flex-wrap: wrap; }
.pc-title b { font-size: 17px; font-weight: 880; }
.pc-title .muted { font-size: 13px; font-weight: 750; margin-left: auto; white-space: nowrap; }
.pc-meta { margin: 0; font-size: 14px; font-weight: 750; color: var(--ink-2); }
.pc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pc-list li.extra { display: none; }
.pc-list.all li.extra { display: list-item; }
.pc-list button:not(.link) { border: 0; background: none; padding: 4px 0; text-align: left; cursor: pointer; font-size: 13px; color: var(--ink-2); width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-list button:not(.link):hover { color: var(--blue); }
.pc-list button b { color: var(--ink); font-weight: 900; margin-right: 4px; }
.btn.small { font-size: 14px; padding: 10px 16px; margin-top: auto; }
@media (max-width: 860px) {
  .howto { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .plate-cards { grid-template-columns: minmax(0, 1fr); }
  .plan-head .btn { width: 100%; }
}
.pc-zoom { position: absolute; bottom: 10px; right: 10px; background: rgba(27,29,41,.78); color: #fff; font-weight: 800; font-size: 11px; padding: 4px 9px; border-radius: 99px; }
.cg-text { display: grid; gap: 2px; min-width: 0; }
.cg-text h3 { line-height: 1.1; }

/* ---------- real 3D bricks (rendered from the LDraw models) ---------- */
.logo-img { width: 44px; height: 44px; display: block; margin: -4px 0 -6px; filter: drop-shadow(0 4px 6px rgba(27,29,41,.18)); }
.hero-3d { position: relative; height: 380px; }
.hero-3d .poster, .hero-3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-3d .poster { object-fit: contain; transition: opacity .6s var(--ease); }
.hero-3d canvas { opacity: 0; transition: opacity .6s var(--ease); touch-action: pan-y; }
.hero-3d.live canvas { opacity: 1; }
.hero-3d.live .poster { opacity: 0; }

/* ---------- error / empty pages ---------- */
.state { grid-column: 1 / -1; text-align: center; padding: 30px 16px 50px; max-width: 520px; margin: 0 auto; }
.state-img { width: 200px; height: 200px; margin: 0 auto 6px; object-fit: contain; display: block; }
.state h2 { margin: 0 0 8px; font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.state p { margin: 0 0 22px; color: var(--ink-2); line-height: 1.55; }

/* ---------- plate cards: picture button + full-screen view ---------- */
button.pc-img { display: block; position: relative; width: 100%; padding: 0; border: 0; background: #2C2F3C; cursor: zoom-in; line-height: 0; }
button.pc-img img { display: block; width: 100%; height: auto; }
.pc-expand { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(27,29,41,.72); color: #fff; font-size: 17px; line-height: 32px; text-align: center; }
.pc-zoom { line-height: 1.2; }
dialog.plate-sheet { width: min(1100px, calc(100% - 24px)); display: none; }
dialog.plate-sheet[open] { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.pl-img { position: relative; background: #2C2F3C; line-height: 0; }
.pl-img img { width: 100%; height: auto; display: block; }
.pl-img .pc-zoom { position: absolute; bottom: 12px; right: 12px; }
.pl-body { padding: 26px 24px 24px; display: grid; gap: 12px; align-content: start; overflow-y: auto; max-height: calc(100vh - 40px); }
.pl-body h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 900; letter-spacing: -.02em; padding-right: 40px; }
.pl-body h2 .sw { width: 28px; height: 28px; }
.pl-body p { margin: 0; }
.pl-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.pl-list b { color: var(--ink); margin-right: 4px; }
@media (max-width: 860px) {
  .hero-3d { height: 230px; order: -1; margin: -6px 0 -10px; }
  dialog.plate-sheet[open] { grid-template-columns: minmax(0, 1fr); }
  .pl-body { max-height: none; }
}
@media (max-width: 560px) {
  .section-head { flex-wrap: wrap; align-items: flex-start; }
  .section-head .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .section-head .tabs button { flex: none; }
  .logo-img { width: 40px; height: 40px; }
  dialog.plate-sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 26px 26px 0 0; max-height: 94%; }
  .state-img { width: 160px; height: 160px; }
}
.loading-more { width: 180px; }
/* card content never wider than the card (long part names were pushing the button out) */
.pc-body { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.pc-list, .pc-list li { min-width: 0; }
.pc-num, .pc-zoom, .pc-expand { line-height: 1.2; }
.pc-expand { line-height: 32px; }
.plan-sub { margin: 26px 0 12px; font-size: 18px; font-weight: 880; letter-spacing: -.01em; }
.filaments { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.filament { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 10px 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.filament .sw { width: 30px; height: 30px; }
.filament span:not(.sw) { display: grid; min-width: 0; }
.filament b { font-size: 14px; font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filament small { font-size: 12px; color: var(--muted); font-weight: 750; }
.plate-card { border-top: 6px solid var(--fil, var(--line)); scroll-margin-top: 90px; }
@media (max-width: 560px) { .filaments { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- codeword page (public route) ---------- */
.unlock-page { padding-bottom: 0; }
.unlock { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; max-width: none; }
.unlock-card { width: min(440px, 100%); background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow-up); padding: 28px 28px 24px; text-align: center; }
.unlock-art { width: 170px; height: 170px; margin: -6px auto 0; display: block; }
.unlock-logo { justify-content: center; margin: 0 0 6px; }
.unlock h1 { margin: 6px 0 8px; font-size: 28px; letter-spacing: -.03em; font-weight: 900; line-height: 1.05; }
.unlock .sub { margin: 0 0 20px; }
.unlock-form { display: grid; gap: 10px; text-align: left; }
.unlock-form .label { margin: 0 !important; }
.unlock-form input { font: inherit; font-size: 18px; font-weight: 800; letter-spacing: .06em; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); outline: none; width: 100%; }
.unlock-form input:focus { border-color: var(--yellow); }
.unlock-form .btn { width: 100%; }
.unlock-msg { margin: 2px 0 0; min-height: 20px; font-size: 14px; font-weight: 750; text-align: center; }
.unlock-msg.bad { color: var(--red-d); }
.unlock-note { margin: 14px 0 0; font-size: 13px; }
.unlock-logo { display: flex; align-items: center; gap: 8px; }
.unlock-logo .logo-word { display: inline !important; font-size: 22px; }
