/* BrickPocket — dark premium theme */
:root {
  --bg: #09090b;
  --bg-2: #0e0e12;
  --surface: #141419;
  --surface-2: #1b1b22;
  --surface-3: #23232c;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f4f1ea;
  --muted: #a29ea8;
  --faint: #6d6974;
  --accent: #f3c24a;
  --accent-soft: rgba(243, 194, 74, .14);
  --accent-ink: #1b1505;
  --red: #e5533d;
  --green: #4fbf8a;
  --blue: #5b8def;
  --bronze: #c9895a;
  --silver: #c8ccd6;
  --gold: #f3c24a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
  --side: 248px;
  --tbar: env(titlebar-area-height, 0px);
  color-scheme: dark;
}
[data-accent="red"]   { --accent: #ef6a4f; --accent-soft: rgba(239,106,79,.14); --accent-ink: #1e0905; }
[data-accent="blue"]  { --accent: #6f9cf5; --accent-soft: rgba(111,156,245,.14); --accent-ink: #050d1e; }
[data-accent="green"] { --accent: #5fcf98; --accent-soft: rgba(95,207,152,.14); --accent-ink: #04170e; }
[data-accent="silver"]{ --accent: #d9dce4; --accent-soft: rgba(217,220,228,.12); --accent-ink: #111216; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(91, 141, 239, .06), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[data-motion="reduce"] *, [data-motion="reduce"] *::before { transition: none !important; animation: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 20;
  padding: calc(22px + var(--tbar)) 16px 20px; display: none; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--line); background: rgba(9, 9, 11, .72); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 6px 20px -6px var(--accent); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-family: var(--serif); font-size: 25px; letter-spacing: -.01em; line-height: 1; }
.brand-name em { color: var(--accent); font-style: italic; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 500; transition: background .15s, color .15s;
}
.nav-link svg { width: 20px; height: 20px; flex: none; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav-link.active svg { color: var(--accent); }
.nav-link .count { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

.main { padding: calc(14px + env(safe-area-inset-top) + var(--tbar)) 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1320px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-height: 40px; }
.topbar .brand { padding: 0; }
.topbar .brand-name { font-size: 22px; }
.topbar .spacer { flex: 1; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: rgba(12, 12, 15, .86);
  backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--faint); padding: 4px 0; letter-spacing: .02em; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--text); }
.tabbar a.active svg { color: var(--accent); }

@media (min-width: 960px) {
  .sidebar { display: flex; }
  .tabbar, .topbar .brand { display: none; }
  .main { margin-left: var(--side); padding: calc(30px + var(--tbar)) 40px 60px; max-width: calc(1320px + var(--side)); }
  .shell { padding-right: 0; }
}
@media (min-width: 960px) { .main { margin-left: calc(var(--side)); } }
@media (min-width: 1600px) { .main { margin-left: auto; padding-left: calc(var(--side) + 40px); } }

/* window controls overlay (installed desktop app) */
.titlebar { display: none; }
@media (display-mode: window-controls-overlay) {
  .titlebar { display: block; position: fixed; top: env(titlebar-area-y, 0); left: env(titlebar-area-x, 0); width: env(titlebar-area-width, 100%); height: env(titlebar-area-height, 32px); -webkit-app-region: drag; app-region: drag; z-index: 50; }
}

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-weight: 400; }
.page-title { font-family: var(--serif); font-size: clamp(34px, 5vw, 50px); line-height: 1.02; letter-spacing: -.015em; }
.page-title em { color: var(--accent); }
.page-sub { color: var(--muted); margin: 8px 0 0; max-width: 60ch; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { font-family: var(--serif); font-size: 27px; letter-spacing: -.01em; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: transform .12s, background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255,255,255,.2); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 8px 24px -10px var(--accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.07); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-danger { color: #ff8b78; border-color: rgba(229, 83, 61, .35); background: rgba(229, 83, 61, .08); }
.btn-danger:hover { background: rgba(229, 83, 61, .16); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; }

.input, .select, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23a29ea8' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.search {
  position: relative; flex: 1; min-width: 180px;
}
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 42px; border-radius: 999px; background: var(--surface); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
kbd { font: 600 11px var(--mono); color: var(--faint); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 18px; }
.toolbar .select { width: auto; height: 40px; border-radius: 999px; background-color: var(--surface); font-size: 14px; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); height: 32px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.seg button svg { width: 16px; height: 16px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.toggle { position: relative; width: 44px; height: 26px; flex: none; }
.toggle input { opacity: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .2s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.toggle input:checked + span { background: var(--accent); border-color: transparent; }
.toggle input:checked + span::after { transform: translateX(18px); background: var(--accent-ink); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-3); color: var(--muted); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.green { background: rgba(79,191,138,.14); color: var(--green); }
.badge.red { background: rgba(229,83,61,.14); color: #ff8b78; }
.badge.blue { background: rgba(91,141,239,.14); color: #8fb1f5; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { padding: 22px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; } }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.set-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s; }
.set-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.set-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.set-card .name { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.set-card .meta { font-size: 12.5px; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.set-card .num-tag { font: 600 11.5px var(--mono); color: var(--muted); }
.set-card .corner { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; }
.set-card .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.set-card .badges .badge { backdrop-filter: blur(8px); background: rgba(9,9,11,.6); }
.round-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(9,9,11,.62); backdrop-filter: blur(8px); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: transform .12s, background .15s; }
.round-btn:hover { transform: scale(1.08); }
.round-btn svg { width: 17px; height: 17px; }
.round-btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.round-btn.heart.on { background: var(--red); color: #fff; }

/* set art */
.art { --h: 45; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(150deg, hsl(var(--h) 45% 22%), hsl(calc(var(--h) + 20) 35% 9%)); }
.art::before { content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(circle at 50% 50%, hsla(var(--h), 70%, 70%, .18) 0 7px, transparent 7.5px), radial-gradient(circle at 50% 46%, rgba(255,255,255,.08) 0 5px, transparent 5.5px);
  background-size: 28px 28px; mask-image: linear-gradient(200deg, #000 10%, transparent 75%); -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 75%); }
.art .art-num { position: absolute; left: 14px; bottom: 6px; font-family: var(--serif); font-size: 46px; line-height: 1; color: hsla(var(--h), 80%, 88%, .9); letter-spacing: -.02em; }
.art .art-theme { position: absolute; left: 15px; bottom: 54px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: hsla(var(--h), 70%, 80%, .6); }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; background: #f3f1ec; opacity: 0; transition: opacity .25s; }
.art img.ok, .art.photo img { opacity: 1; }
.art.photo img { object-fit: cover; padding: 0; background: #000; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); padding: 18px 20px; }
.stat .v { font-family: var(--serif); font-size: clamp(32px, 4vw, 44px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { margin-top: 8px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .d { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 28px; border: 1px solid var(--line-2);
  background: linear-gradient(135deg, var(--surface-2), var(--surface) 60%); }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }
@media (min-width: 760px) { .hero { padding: 36px 40px; } }

/* bars */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; gap: 12px; align-items: center; font-size: 13.5px; }
.bar-row .track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar-row .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-row .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* horizontal scroller */
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 82%); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.scroller > * { scroll-snap-align: start; }
@media (min-width: 760px) { .scroller { grid-auto-columns: minmax(320px, 400px); } }
.scroller.small { grid-auto-columns: minmax(170px, 46%); }
@media (min-width: 760px) { .scroller.small { grid-auto-columns: 210px; } }

.pick { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; transition: transform .18s; }
.pick:hover { transform: translateY(-3px); }
.pick .art { aspect-ratio: 16 / 10; }
.pick .art .art-num { font-size: 64px; }
.pick .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.pick .label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.pick h3 { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.pick p { margin: 0; color: var(--muted); font-size: 14px; }
.pick .foot { font-size: 12.5px; color: var(--faint); margin-top: 4px; }

.reason { font-size: 12px; color: var(--accent); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* list rows */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:hover { background: rgba(255,255,255,.015); }
.row .thumb { width: 72px; flex: none; border-radius: 10px; overflow: hidden; }
.row .thumb .art-num { font-size: 22px; left: 8px; bottom: 3px; }
.row .thumb .art-theme { display: none; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 12.5px; color: var(--faint); }
.row .right { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* minifigs */
.fig { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.fig-avatar { width: 54px; height: 54px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--surface-3); overflow: hidden; }
.fig-avatar img { width: 100%; height: 100%; object-fit: contain; background: #f3f1ec; }
.fig-avatar svg { width: 34px; height: 34px; }
.fig .grow { flex: 1; min-width: 0; }
.fig .name { font-weight: 600; }
.fig .in { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.fig .in a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.fig.owned { border-color: rgba(243,194,74,.25); }
.fig-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.stepper button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; }
.stepper button:hover { background: var(--surface-3); color: var(--text); }
.stepper span { min-width: 20px; text-align: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }

/* achievements */
.ach-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ach { position: relative; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; gap: 14px; }
.ach.locked .medal { filter: grayscale(1); opacity: .35; }
.ach .grow { flex: 1; min-width: 0; }
.ach h4 { margin: 0; font-size: 15px; font-weight: 700; }
.ach p { margin: 3px 0 10px; font-size: 13px; color: var(--muted); }
.ach .prog { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ach .prog i { display: block; height: 100%; background: var(--tier, var(--accent)); border-radius: 99px; }
.ach .pmeta { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 6px; font-variant-numeric: tabular-nums; }
.medal { width: 56px; height: 56px; flex: none; }
.tiers { display: flex; gap: 4px; margin-top: 8px; }
.tiers i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.tiers i.b { background: var(--bronze); } .tiers i.s { background: var(--silver); } .tiers i.g { background: var(--gold); }

/* ---------- modal / sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-height: 92vh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 24px 24px 0 0; animation: rise .28s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; }
@media (min-width: 760px) {
  .overlay { align-items: center; padding: 30px; }
  .sheet { max-width: 920px; border-radius: 24px; max-height: 88vh; }
  .sheet.narrow { max-width: 480px; }
}
.sheet-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: rgba(14,14,18,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.sheet-body { padding: 20px; }
@media (min-width: 760px) { .sheet-body { padding: 26px 30px 30px; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.detail { display: grid; gap: 24px; }
@media (min-width: 760px) { .detail { grid-template-columns: 1.05fr 1fr; gap: 30px; } }
.detail .art { border-radius: 18px; aspect-ratio: 4/3.2; }
.detail .art .art-num { font-size: 84px; left: 20px; }
.detail .art .art-theme { left: 22px; bottom: 92px; }
.detail h2 { font-family: var(--serif); font-size: 36px; line-height: 1.05; letter-spacing: -.01em; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 18px 0; }
.facts div { background: var(--surface); padding: 12px 14px; }
.facts b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; }
.facts span { font-size: 11.5px; color: var(--faint); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; }
.photo-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; text-align: center; }
.photo-add:hover { border-color: var(--accent); color: var(--accent); }
.photo-add svg { width: 22px; height: 22px; margin: 0 auto 4px; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fade .2s; }
.lightbox img { max-height: 90vh; max-width: 100%; border-radius: 12px; }

.owned-box { margin-top: 22px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }

/* settings lists */
.list { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; font-size: 14.5px; }
.item .s { font-size: 12.5px; color: var(--faint); }
.item .select { width: auto; height: 36px; font-size: 13.5px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--line-2); }
.swatch.on { border-color: var(--bg); box-shadow: 0 0 0 2px var(--text); }

.profile-head { display: flex; align-items: center; gap: 18px; }
.avatar { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 34px; background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #000)); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line-2); flex: none; }

.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-2); border-radius: 22px; }
.empty .ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .ic svg { width: 30px; height: 30px; }
.empty h3 { font-family: var(--serif); font-size: 28px; }
.empty p { color: var(--muted); max-width: 42ch; margin: 8px auto 20px; }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 28px; left: calc(50% + var(--side) / 2); } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; font-weight: 500; animation: rise .25s; max-width: 92vw; }
.toast svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.toast.ach { background: linear-gradient(120deg, #2a2210, var(--surface-3)); border-color: rgba(243,194,74,.35); }

.install-card { padding: 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid rgba(243,194,74,.2); font-size: 13px; }
.install-card b { display: block; margin-bottom: 2px; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); }
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.sync-pill.on i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sync-pill.busy i { background: var(--accent); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }

.footer-note { margin: 50px 0 10px; font-size: 11.5px; color: var(--faint); text-align: center; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.split { display: grid; gap: 20px; }
@media (min-width: 1000px) { .split { grid-template-columns: 1.4fr 1fr; } }
.kpi-line { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 22px; position: relative; z-index: 1; }
.kpi-line div b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1; }
.kpi-line div span { font-size: 12px; color: var(--muted); }
.next-ach { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.next-ach:last-child { border-bottom: 0; }
.next-ach .medal { width: 40px; height: 40px; }
.mini-prog { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 7px; }
.mini-prog i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
@media (max-width: 700px) { .hide-mobile { display: none; } .bar-row { grid-template-columns: 100px 1fr 36px; } }
.pick .label svg, .badge svg, .reason svg { width: 14px; height: 14px; flex: none; }
[hidden] { display: none !important; }
.chip-select { flex: none; width: auto; height: 32px; border-radius: 999px; font-size: 13px; font-weight: 600; padding: 0 34px 0 14px; color: var(--muted); background-color: transparent; }
.chip-select.on { background-color: var(--text); color: var(--bg); border-color: var(--text); }
