:root {
  --paper: #f6f1e7; --paper-2: #efe8d9; --ink: #1d1a16; --ink-2: #4a443b; --ink-3: #7c7466; --line: #d9d0bf;
  --orange: #e8602c; --orange-dark: #c24a1b; --teal: #1f6f78; --teal-light: #d9ecee; --yellow: #f2c14e; --green: #2e7d32; --red: #c62828;
  --card: #fffdf8; --shadow: 0 1px 2px rgba(29,26,22,.06), 0 8px 24px -12px rgba(29,26,22,.25); --radius: 10px;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', sans-serif; --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif; --font-mono: 'IBM Plex Mono', Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #17150f; --paper-2: #1f1c15; --ink: #f1ebdf; --ink-2: #c9c1b1; --ink-3: #8f8777; --line: #342f26; --card: #221f18; --teal-light: #1c3538; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); }
}
:root[data-theme="dark"] { --paper: #17150f; --paper-2: #1f1c15; --ink: #f1ebdf; --ink-2: #c9c1b1; --ink-3: #8f8777; --line: #342f26; --card: #221f18; --teal-light: #1c3538; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; opacity: .3; }
main { position: relative; z-index: 1; flex: 1; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -.01em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); } h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-decoration: none; } a:hover { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
code, pre { font-family: var(--font-mono); font-size: .92em; }
pre { background: var(--paper-2); border: 1px solid var(--line); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
code:not(pre code) { background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.narrow { max-width: 760px; }
.section { padding: 2.5rem 0; } .section.alt { background: var(--paper-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.eyebrow { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin-bottom: .5rem; }
.muted { color: var(--ink-3); } .small { font-size: .875rem; } .mt { margin-top: 2rem; } .lead { font-size: 1.15rem; color: var(--ink-2); }
.row { display: flex; align-items: center; } .gap { gap: .6rem; } .wrap-row { flex-wrap: wrap; } .grow { flex: 1; } .between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.hidden { display: none !important; }
.inline { display: inline; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.grid.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.prose { max-width: 70ch; } .prose img { border-radius: var(--radius); } .prose h2 { margin-top: 1.8rem; } .prose ul, .prose ol { padding-left: 1.3em; } .prose blockquote { border-left: 4px solid var(--yellow); margin: 1.2rem 0; padding: .4rem 1rem; background: var(--paper-2); }
.prose table { border-collapse: collapse; } .prose td, .prose th { border: 1px solid var(--line); padding: .3em .6em; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; background: var(--orange); color: #fff; font-family: var(--font-display); font-weight: 700; padding: .65rem 1.1rem; border-radius: 999px; text-decoration: none; border: 2px solid var(--orange); cursor: pointer; font-size: .95rem; line-height: 1.1; transition: transform .12s, background .12s; }
.btn:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); } .btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.small { padding: .4rem .8rem; font-size: .85rem; } .btn.teal { background: var(--teal); border-color: var(--teal); } .btn.danger { background: var(--red); border-color: var(--red); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font: inherit; font-size: .875rem; } .linkish:hover { color: var(--orange); text-decoration: underline; } .linkish.danger { color: var(--red); }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; font-size: .92rem; }
label.inline-check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number], textarea, select { width: 100%; font: inherit; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
textarea { resize: vertical; min-height: 90px; }
input[type=file] { font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; } legend { font-family: var(--font-display); font-weight: 700; padding: 0 .4rem; }
.help { color: var(--ink-3); font-size: .82rem; font-weight: 400; }
.flashes { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.flash { padding: .7rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: .92rem; }
.flash.success { border-color: #a5d6a7; background: rgba(76,175,80,.1); } .flash.error { border-color: #ef9a9a; background: rgba(244,67,54,.1); } .flash.info { border-color: #90caf9; background: rgba(33,150,243,.1); }
.notice { padding: .8rem 1rem; border-radius: 8px; border: 1px dashed var(--line); background: var(--paper-2); font-size: .9rem; }
.notice.warn { border-color: var(--yellow); background: rgba(242,193,78,.15); }
#toast { position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 999px; opacity: 0; transition: .2s; z-index: 100; pointer-events: none; font-size: .9rem; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 1.25rem; max-width: 420px; width: calc(100% - 32px); } .dialog::backdrop { background: rgba(0,0,0,.5); }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1rem; height: 60px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--ink); display: flex; align-items: center; gap: .35rem; letter-spacing: -.02em; white-space: nowrap; } .logo em { color: var(--orange); font-style: normal; } .logo:hover { text-decoration: none; }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--orange); color: #fff; font-size: 1.1rem; }
.main-nav { display: flex; gap: .2rem; } .main-nav a { padding: .4rem .7rem; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: .95rem; } .main-nav a.active, .main-nav a:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.search { flex: 1; max-width: 360px; margin-left: auto; } .search input { border-radius: 999px; padding: .5rem 1rem; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn { position: relative; font-size: 1.1rem; padding: .3rem .4rem; border-radius: 8px; color: var(--ink); } .icon-btn:hover { background: var(--paper-2); text-decoration: none; }
.badge-dot { position: absolute; top: -2px; right: -4px; background: var(--orange); color: #fff; font-size: .62rem; font-weight: 700; border-radius: 999px; padding: 0 .35em; line-height: 1.5; }
.user-menu { position: relative; } .user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem; padding: .25rem .5rem; border-radius: 999px; } .user-menu summary::-webkit-details-marker { display: none; } .user-menu summary:hover { background: var(--paper-2); }
.user-menu .menu { position: absolute; right: 0; top: 110%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 190px; display: flex; flex-direction: column; padding: .4rem; z-index: 60; }
.user-menu .menu a, .user-menu .menu button { padding: .5rem .7rem; border-radius: 6px; color: var(--ink); text-align: left; font-size: .92rem; } .user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--paper-2); text-decoration: none; }
.admin-link { color: var(--orange) !important; font-weight: 600; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--paper-2); } .avatar.xs { width: 26px; height: 26px; } .avatar.sm { width: 40px; height: 40px; } .avatar.md { width: 56px; height: 56px; } .avatar.lg { width: 96px; height: 96px; }
.tabbar { display: none; }

/* hero */
.hero { padding: 3rem 0 2rem; }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); } .hl { color: var(--orange); }
.stat-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.stat-strip li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; } .stat-strip b { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; } .stat-strip span { color: var(--ink-3); font-size: .85rem; }

/* post cards */
.post-card, .listing-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.post-card:hover, .listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.thumb-link { position: relative; display: block; aspect-ratio: 16/10; background: var(--paper-2); overflow: hidden; }
.listing-card .thumb-link { aspect-ratio: 1; }
.thumb-link img, .thumb-link video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem; background: linear-gradient(135deg, var(--teal-light), var(--paper-2)); }
.play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 2rem; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.type-pill { position: absolute; left: .5rem; bottom: .5rem; background: rgba(0,0,0,.65); color: #fff; font-size: .7rem; padding: .15em .5em; border-radius: 999px; font-family: var(--font-mono); }
.post-card-body, .listing-card-body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.post-card h3, .listing-card h3 { font-size: 1.02rem; margin: 0; line-height: 1.3; } .post-card h3 a, .listing-card h3 a { color: var(--ink); } .post-card h3 a:hover { color: var(--orange); }
.meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .82rem; color: var(--ink-3); }
.cat-chip { font-family: var(--font-mono); font-size: .72rem; background: var(--teal-light); color: var(--teal); padding: .15em .55em; border-radius: 999px; white-space: nowrap; } .cat-chip:hover { background: var(--teal); color: #fff; text-decoration: none; }
.post-stats { display: flex; gap: .9rem; align-items: center; font-size: .85rem; color: var(--ink-2); margin-top: auto; padding-top: .3rem; }
.post-stats a { color: var(--ink-2); }
.vote-inline { display: inline-flex; align-items: center; gap: .2rem; } .vote-inline button { background: none; border: 0; cursor: pointer; color: var(--ink-3); font-size: .9rem; padding: .1rem .25rem; border-radius: 4px; line-height: 1; } .vote-inline button:hover { background: var(--paper-2); color: var(--ink); }
.vote-inline .score { min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
.vote-inline.voted-up .up, .vote-inline.voted-up .score { color: var(--orange); } .vote-inline.voted-down .down, .vote-inline.voted-down .score { color: var(--teal); }
.vote-inline.vertical { flex-direction: column; gap: 0; } .vote-inline.big button { font-size: 1.3rem; } .vote-inline.big .score { font-size: 1.1rem; font-weight: 700; }
.vote-inline.light button, .vote-inline.light .score { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.source { margin: 0; }
.price { font-family: var(--font-display); font-size: 1.1rem; } .price-row { display: flex; justify-content: space-between; align-items: center; } .pay-icons { font-size: .9rem; letter-spacing: .1em; }
.listing-card.inactive { opacity: .7; }

/* lists */
.talked-list { padding-left: 1.4em; margin: 0; } .talked-list li { margin-bottom: .9rem; } .talked-list a { font-weight: 600; color: var(--ink); } .talked-list a:hover { color: var(--orange); }
.thread-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.thread-row { display: grid; grid-template-columns: 44px 1fr auto; gap: .6rem; align-items: center; padding: .75rem .9rem; border-bottom: 1px solid var(--line); } .thread-row:last-child { border-bottom: 0; }
.thread-row.pinned { background: rgba(242,193,78,.12); }
.thread-row h3 { font-size: 1rem; margin: 0 0 .15rem; font-weight: 700; } .thread-row h3 a { color: var(--ink); } .thread-row h3 a:hover { color: var(--orange); }
.thread-counts { display: flex; gap: .8rem; font-size: .82rem; color: var(--ink-3); white-space: nowrap; }
.thread-list.compact .thread-row { padding: .55rem .8rem; }
.video-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
.video-tile { position: relative; aspect-ratio: 9/14; border-radius: var(--radius); overflow: hidden; background: var(--ink); scroll-snap-align: start; display: block; }
.video-tile img, .video-tile video { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.video-tile .thumb-fallback { height: 100%; }
.video-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem .7rem .7rem; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; font-weight: 600; font-size: .85rem; line-height: 1.25; }
.cat-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cat-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; display: flex; flex-direction: column; gap: .2rem; color: var(--ink); } .cat-tile:hover { border-color: var(--orange); text-decoration: none; } .cat-icon { font-size: 1.5rem; }
.person-chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem .25rem .3rem; color: var(--ink); }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.sort-tabs { display: flex; gap: .3rem; flex-wrap: wrap; } .sort-tabs a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; background: var(--card); } .sort-tabs a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); } .sort-tabs a:hover { text-decoration: none; border-color: var(--ink); }

/* post page */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; }
.post-hero { background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.2rem; }
.post-hero video, .post-hero img { width: 100%; max-height: 70vh; object-fit: contain; display: block; background: #000; }
.embed { aspect-ratio: 16/9; } .embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.post-title { font-size: clamp(1.5rem, 3.5vw, 2.3rem); }
.post-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .8rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 1rem 0; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin: 1rem 0; } .spec { background: var(--paper-2); border-radius: 8px; padding: .5rem .7rem; font-size: .88rem; } .spec b { display: block; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.badge { display: inline-flex; align-items: center; gap: .35em; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; padding: .2em .55em; border-radius: 4px; border: 1px solid var(--line); }
.badge.easy { color: #2e7d32; border-color: #a5d6a7; background: rgba(76,175,80,.08); } .badge.medium { color: #b26a00; border-color: #ffcc80; background: rgba(255,152,0,.08); } .badge.hard { color: #c62828; border-color: #ef9a9a; background: rgba(244,67,54,.08); }
.tag { display: inline-block; font-family: var(--font-mono); font-size: .75rem; background: var(--teal-light); color: var(--teal); padding: .2em .6em; border-radius: 999px; margin: 0 .3em .3em 0; } .tag:hover { background: var(--teal); color: #fff; text-decoration: none; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.2rem; }
.side-card h4 { margin: 0 0 .6rem; font-size: .95rem; }
.related { display: flex; flex-direction: column; gap: .6rem; } .related a { display: grid; grid-template-columns: 72px 1fr; gap: .6rem; align-items: center; color: var(--ink); font-size: .88rem; line-height: 1.3; } .related img, .related .thumb-fallback { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; font-size: 1.2rem; }
.comments { margin-top: 2rem; } .comment { padding: .8rem 0 .3rem; border-top: 1px solid var(--line); } .comment-children { margin-left: 1.2rem; padding-left: .8rem; border-left: 2px solid var(--line); }
.comment-head { display: flex; align-items: center; gap: .5rem; font-size: .88rem; } .comment-head .uname { font-weight: 600; color: var(--ink); }
.comment-body { margin: .3rem 0; } .comment-body p:last-child { margin-bottom: 0; }
.comment-actions { display: flex; gap: .8rem; align-items: center; font-size: .85rem; }
.comment.removed .comment-body { color: var(--ink-3); }
.reply-form { margin: .6rem 0; display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; } .reply-form textarea { width: 100%; }
.role-pill { font-family: var(--font-mono); font-size: .65rem; text-transform: uppercase; background: var(--orange); color: #fff; padding: .1em .45em; border-radius: 4px; } .role-pill.op { background: var(--teal); }
.answer { border: 2px solid var(--green); border-radius: var(--radius); padding: .6rem 1rem; background: rgba(46,125,50,.06); }
.answer-label { color: var(--green); font-weight: 700; font-size: .85rem; }
.op-post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }

/* submit form */
.type-switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; } .type-switch label { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; cursor: pointer; align-items: center; text-align: center; gap: .1rem; background: var(--card); } .type-switch input { position: absolute; opacity: 0; } .type-switch label:has(input:checked) { border-color: var(--orange); background: rgba(232,96,44,.08); } .type-switch .big { font-size: 1.4rem; }
.autocat { font-size: .9rem; padding: .6rem .8rem; background: var(--teal-light); border-radius: 8px; color: var(--teal); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }

/* profile */
.profile-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; padding: 2rem 0 1rem; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .9rem; } .profile-stats b { font-family: var(--font-display); font-size: 1.2rem; display: block; line-height: 1; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; } .badges span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .15em .6em; font-size: .8rem; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; } .tabs a { padding: .6rem .9rem; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; } .tabs a.active { color: var(--orange); border-color: var(--orange); font-weight: 600; } .tabs a:hover { text-decoration: none; color: var(--ink); }
.makers-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } .maker-card { display: grid; grid-template-columns: 56px 1fr; gap: .8rem; align-items: start; }
.notif { display: flex; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); } .notif.unread { background: rgba(232,96,44,.06); } .notif-kind { font-size: 1.3rem; }

/* market */
.market-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; align-items: start; }
.filter-list { display: flex; flex-direction: column; gap: .15rem; } .filter-list a { padding: .35rem .6rem; border-radius: 6px; color: var(--ink-2); display: flex; justify-content: space-between; font-size: .9rem; } .filter-list a.active, .filter-list a:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.listing-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 2.5rem; align-items: start; }
.gallery { display: grid; gap: .5rem; } .gallery .main { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); } .gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: .4rem; flex-wrap: wrap; } .gallery .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; } .gallery .thumbs img.active { border-color: var(--orange); }
.buy-box { position: sticky; top: 76px; }
.buy-box .price { font-size: 2rem; }
.pay-list { list-style: none; padding: 0; margin: .6rem 0; display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.escrow-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; } .escrow-steps li { display: grid; grid-template-columns: 28px 1fr; gap: .5rem; font-size: .9rem; } .escrow-steps li::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.status-pill { display: inline-block; padding: .2em .7em; border-radius: 999px; font-size: .8rem; font-weight: 600; font-family: var(--font-mono); background: var(--paper-2); border: 1px solid var(--line); }
.status-pill.funded, .status-pill.shipped, .status-pill.delivered { background: rgba(31,111,120,.12); color: var(--teal); border-color: var(--teal); }
.status-pill.released { background: rgba(46,125,50,.12); color: var(--green); border-color: var(--green); }
.status-pill.disputed, .status-pill.refunded { background: rgba(198,40,40,.1); color: var(--red); border-color: var(--red); }
.status-pill.pending_payment, .status-pill.awaiting_confirmation { background: rgba(242,193,78,.2); color: #8a5a00; border-color: var(--yellow); }
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; margin: 1rem 0; } .progress span { height: 6px; border-radius: 3px; background: var(--line); } .progress span.done { background: var(--teal); } .progress span.bad { background: var(--red); }
.progress-labels { display: grid; grid-template-columns: repeat(5, 1fr); font-size: .7rem; color: var(--ink-3); text-align: center; font-family: var(--font-mono); }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { display: grid; grid-template-columns: 110px 1fr; gap: .8rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; } .timeline time { color: var(--ink-3); font-family: var(--font-mono); font-size: .75rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .92rem; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; word-break: break-all; }
.deposit-box { background: var(--paper-2); border: 2px dashed var(--teal); border-radius: var(--radius); padding: 1rem; } .mono { font-family: var(--font-mono); font-size: .9rem; }
.msg { padding: .5rem .8rem; border-radius: 10px; background: var(--paper-2); margin-bottom: .5rem; max-width: 80%; font-size: .92rem; } .msg.mine { background: var(--teal-light); margin-left: auto; } .msg .meta { margin-bottom: .2rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; } table.data th, table.data td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } table.data th { background: var(--paper-2); font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; } table.data tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* watch */
body.full .site-header, body.full .site-footer, body.full .tabbar { display: none; }
body.full main { height: 100vh; height: 100dvh; }
.watch-feed { height: 100vh; height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory; background: #000; }
.watch-item { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; display: grid; place-items: center; }
.watch-media { width: min(100vw, calc(100dvh * 9 / 16 + 120px)); height: 100%; display: grid; place-items: center; position: relative; }
.watch-media video { max-height: 100%; max-width: 100%; width: 100%; height: 100%; object-fit: contain; } .watch-media iframe { width: 100%; aspect-ratio: 16/9; max-height: 100%; border: 0; }
.watch-media:has(iframe) { width: min(100vw, calc(100dvh * 16 / 9)); }
.mute-btn { position: absolute; top: 1rem; left: 1rem; background: rgba(0,0,0,.5); color: #fff; border: 0; border-radius: 999px; padding: .4rem .6rem; cursor: pointer; }
.watch-side { position: absolute; right: max(12px, calc(50% - 50dvh * 9 / 16 - 70px)); bottom: 110px; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.side-btn { background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; font-size: 1.5rem; cursor: pointer; text-shadow: 0 1px 4px rgba(0,0,0,.6); } .side-btn small { font-size: .7rem; } .side-btn.active { color: var(--yellow); }
.watch-caption { position: absolute; left: max(12px, calc(50% - 50dvh * 9 / 16 - 70px)); right: 80px; bottom: 24px; color: #fff; max-width: 520px; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.watch-caption h2 { font-size: 1.15rem; margin: .2rem 0; } .watch-caption a { color: #fff; } .light-link { color: var(--yellow) !important; } .meta.light, .meta.light a { color: rgba(255,255,255,.8); }
.watch-exit { position: fixed; top: 14px; right: 14px; background: rgba(0,0,0,.55); color: #fff; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; z-index: 5; font-size: 1.1rem; } .watch-exit:hover { background: var(--orange); text-decoration: none; }
.watch-empty { color: #fff; text-align: center; padding: 20vh 1rem; }

/* admin */
.admin-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 2rem; align-items: start; padding: 2rem 0; }
.admin-nav { display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 76px; } .admin-nav a { padding: .45rem .7rem; border-radius: 6px; color: var(--ink-2); } .admin-nav a.active, .admin-nav a:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; } .stat-cards .card { padding: .9rem; } .stat-cards b { font-family: var(--font-display); font-size: 1.6rem; display: block; line-height: 1; } .stat-cards span { color: var(--ink-3); font-size: .8rem; } .stat-cards .card.alert { border-color: var(--orange); }
.inline-form { display: inline-flex; gap: .3rem; align-items: center; } .inline-form select, .inline-form input { width: auto; padding: .3rem .5rem; font-size: .85rem; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 5rem; font-size: .88rem; color: var(--ink-2); position: relative; z-index: 1; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; } .footer-nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }

@media (max-width: 960px) {
  .hero-inner, .two-col, .post-layout, .listing-layout, .market-layout, .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .buy-box { position: static; }
  .main-nav { display: none; }
  .search { max-width: none; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .header-inner { gap: .5rem; } .uname { display: none; } .search { display: none; }
  .btn.small .hide-sm { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 50; padding: .3rem 0 calc(.3rem + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; font-size: .65rem; color: var(--ink-2); gap: .1rem; } .tabbar a span { font-size: 1.2rem; } .tabbar a.active { color: var(--orange); } .tabbar .tab-post span { background: var(--orange); color: #fff; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
  .site-footer { padding-bottom: 6rem; }
  .form-grid, .type-switch { grid-template-columns: 1fr 1fr; }
  .profile-head { grid-template-columns: auto 1fr; } .profile-head > :last-child { grid-column: 1 / -1; }
  .thread-row { grid-template-columns: 36px 1fr; } .thread-counts { grid-column: 2; }
  .watch-side { bottom: 140px; } .watch-caption { right: 70px; bottom: 60px; }
  .timeline li, .kv { grid-template-columns: 1fr; }
}

/* file library */
.lib-cats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin: 1.5rem 0; }
.lib-cat { display: flex; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s; }
.lib-cat:hover { transform: translateY(-3px); text-decoration: none; } .lib-cat:hover h2 { color: var(--orange); }
.lib-cat h2 { font-size: 1.25rem; margin: 0 0 .2rem; } .lib-cat p { font-size: .9rem; margin: 0 0 .4rem; }
.lib-icon { font-size: 2rem; color: var(--orange); line-height: 1; }
.lib-count { font-family: var(--font-mono); font-size: .78rem; color: var(--teal); }
.lib-jump { margin: .5rem 0 1.5rem; } .lib-group { margin-top: 2.2rem; } .lib-group h2 { font-size: 1.4rem; }
.file-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .35rem; }
.file-card h3 { font-size: 1.1rem; margin: .1rem 0; } .file-card p { margin: 0; }
.file-card .lic { font-family: var(--font-mono); font-size: .68rem; background: var(--paper-2); border: 1px solid var(--line); padding: .15em .5em; border-radius: 4px; white-space: nowrap; }
.file-card .dim { opacity: .75; font-weight: 400; font-size: .78rem; }
.file-cite { margin-top: .5rem; padding-top: .6rem; border-top: 1px dashed var(--line); color: var(--ink-3); }

/* ===== home three-column layout, rails ===== */
.hero-compact { padding: 2rem 0 1.2rem; } .hero-compact h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); } .hero-compact .lead { font-size: 1.02rem; margin-bottom: .8rem; }
.home-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 290px; gap: 1.5rem; align-items: start; padding: 1rem 0 3rem; }
.home-main .section-head { margin-bottom: .8rem; } .home-main .mt { margin-top: 2rem; }
.rail { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 72px; max-height: calc(100vh - 84px); overflow-y: auto; scrollbar-width: thin; }
.rail-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; }
.rail-card h4 { margin: 0 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-mono); color: var(--ink-3); font-weight: 600; }
.rail-link { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem .45rem; margin: 0 -.45rem; border-radius: 6px; color: var(--ink-2); font-size: .9rem; }
.rail-link:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; } .rail-link.active { background: var(--teal-light); color: var(--teal); font-weight: 600; }
.rail-link b { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; color: var(--ink-3); }
.rail-item { display: grid; grid-template-columns: 44px 1fr; gap: .6rem; align-items: center; padding: .4rem 0; border-top: 1px solid var(--line); color: var(--ink); font-size: .88rem; } .rail-item:first-of-type { border-top: 0; } .rail-item:hover { text-decoration: none; } .rail-item:hover .rail-title { color: var(--orange); }
.rail-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; } .rail-item .avatar.xs { width: 28px; height: 28px; margin-left: 8px; }
.rail-thumb { width: 44px; height: 44px; display: grid; place-items: center; background: var(--paper-2); border-radius: 6px; font-size: 1.2rem; }
.rail-title { display: block; line-height: 1.3; font-weight: 500; }
.rail-makers { display: flex; flex-wrap: wrap; gap: .6rem; } .rail-maker { display: flex; flex-direction: column; align-items: center; gap: .15rem; color: var(--ink-2); width: 62px; text-align: center; } .rail-maker .small { font-size: .68rem; overflow: hidden; text-overflow: ellipsis; max-width: 62px; white-space: nowrap; }
.talked-list.two-up { columns: 2; column-gap: 2rem; } .talked-list.two-up li { break-inside: avoid; }
.sort-tabs.small a { padding: .25rem .6rem; font-size: .8rem; }

/* ===== feed layout (posts + templates lists) ===== */
.feed-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.8rem; align-items: start; }

/* ===== view toggle + compact view ===== */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.view-toggle .vt { background: none; border: 0; padding: .3rem .65rem; cursor: pointer; color: var(--ink-3); font-size: .95rem; line-height: 1; } .view-toggle .vt:hover { color: var(--ink); }
.view-toggle .vt-grid { color: var(--orange); } html.view-compact .view-toggle .vt-grid { color: var(--ink-3); } html.view-compact .view-toggle .vt-compact { color: var(--orange); }
html.view-compact .grid.cards[data-viewable] { display: flex; flex-direction: column; gap: .4rem; }
html.view-compact [data-viewable] .post-card, html.view-compact [data-viewable] .listing-card, html.view-compact [data-viewable] .tpl-card { flex-direction: row; align-items: center; transform: none !important; }
html.view-compact [data-viewable] .post-card .thumb-link { width: 128px; aspect-ratio: 16/10; flex: none; }
html.view-compact [data-viewable] .listing-card .thumb-link { width: 72px; aspect-ratio: 1; flex: none; }
html.view-compact [data-viewable] .thumb-link .play { font-size: 1.1rem; } html.view-compact [data-viewable] .type-pill { display: none; }
html.view-compact [data-viewable] .post-card-body, html.view-compact [data-viewable] .listing-card-body { padding: .45rem .8rem; gap: .15rem; flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: 1rem; }
html.view-compact [data-viewable] .post-card h3, html.view-compact [data-viewable] .listing-card h3 { font-size: .95rem; flex: 1 1 260px; order: -1; }
html.view-compact [data-viewable] .post-card .source, html.view-compact [data-viewable] .thumb-fallback span { display: none; }
html.view-compact [data-viewable] .post-stats { margin-top: 0; padding-top: 0; font-size: .8rem; }
html.view-compact [data-viewable] .tpl-preview { width: 96px; aspect-ratio: 1; flex: none; border-radius: 6px 0 0 6px; }
html.view-compact [data-viewable] .tpl-body { padding: .45rem .8rem; gap: .2rem; } html.view-compact [data-viewable] .tpl-desc, html.view-compact [data-viewable] .tpl-card .file-cite { display: none; }
html.view-compact [data-viewable] .tpl-body h3 { font-size: .95rem; } html.view-compact [data-viewable] .tpl-actions .btn { padding: .25rem .55rem; font-size: .75rem; }

/* ===== templates ===== */
.tpl-sections { display: grid; gap: 2.5rem; margin-top: 1.5rem; }
.tpl-section { padding: 1.4rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.tpl-laser { border-top: 4px solid var(--orange); } .tpl-cnc { border-top: 4px solid var(--teal); }
.tpl-section-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; } .tpl-section-head h2 { margin: 0 0 .2rem; font-size: 1.5rem; } .tpl-section-head h2 a { color: var(--ink); }
.tpl-big-icon { font-size: 2.6rem; line-height: 1; color: var(--orange); } .tpl-cnc .tpl-big-icon { color: var(--teal); }
.tpl-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tpl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; } .tpl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tpl-preview { position: relative; display: block; aspect-ratio: 4/3; background: #fff; overflow: hidden; border-bottom: 1px solid var(--line); }
.tpl-preview img { width: 100%; height: 100%; object-fit: contain; padding: 6%; display: block; }
.tpl-fallback { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: .2rem; background: linear-gradient(135deg, var(--paper-2), var(--teal-light)); color: var(--teal); } .tpl-fallback span { font-size: 2.6rem; line-height: 1; } .tpl-fallback b { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; }
.tpl-body { padding: .75rem .9rem .9rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; } .tpl-body h3 { font-size: 1rem; margin: 0; line-height: 1.3; }
.tpl-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.tpl-formats { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.fmt { font-family: var(--font-mono); font-size: .68rem; border: 1px solid var(--line); border-radius: 4px; padding: .1em .45em; color: var(--ink-2); background: var(--paper-2); }
.tpl-formats .lic { margin-left: auto; font-family: var(--font-mono); font-size: .66rem; color: var(--ink-3); }
.tpl-actions { margin-top: auto; padding-top: .3rem; } .tpl-actions .dim { opacity: .75; font-weight: 400; font-size: .75rem; }

@media (max-width: 1100px) { .home-layout { grid-template-columns: 220px minmax(0, 1fr); } .rail-right { grid-column: 1 / -1; position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 860px) { .home-layout, .feed-layout { grid-template-columns: 1fr; } .rail { position: static; max-height: none; } .rail-left { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } .rail-cats { max-height: 320px; overflow-y: auto; } .talked-list.two-up { columns: 1; } .tpl-section-head { grid-template-columns: auto 1fr; } .tpl-section-head .btn { grid-column: 1 / -1; justify-self: start; } }

/* ===== fluid width: wide pages grow with the browser, rails scale with the viewport ===== */
.wrap.wide { max-width: 1800px; }
.home-layout { grid-template-columns: clamp(210px, 15vw, 290px) minmax(0, 1fr) clamp(250px, 17vw, 340px); }
.feed-layout { grid-template-columns: clamp(210px, 15vw, 280px) minmax(0, 1fr); }
.rail-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1700px) { .grid.cards, .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); } }
@media (max-width: 1100px) { .home-layout { grid-template-columns: clamp(200px, 22vw, 250px) minmax(0, 1fr); } }
@media (max-width: 860px) { .home-layout, .feed-layout { grid-template-columns: 1fr; } }

/* ===== admin stats ===== */
.stats-page .stat-cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.stats-page .stat-cards .card span { display: block; margin-top: .25rem; }
.stats-kpis .card b { color: var(--orange); }
.stats-jump { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0 0 1.2rem; padding: .6rem .8rem; background: var(--paper-2); border-radius: var(--radius); }
.stats-sec { margin-top: 2.6rem; scroll-margin-top: 72px; } .stats-sec > h2 { border-bottom: 2px solid var(--line); padding-bottom: .4rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; margin-top: 1rem; }
.stats-grid.three { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.stats-page .card h4 { margin: 0 0 .6rem; font-size: .95rem; } .stats-page .card h4 .muted { font-weight: 400; font-size: .82rem; }
.chart { width: 100%; height: 150px; display: block; } .chart rect:hover { opacity: .75; } .chart-lbl { font: 10px var(--font-mono); fill: var(--ink-3); }
.up { color: var(--green); font-weight: 600; font-size: .78rem; } .down { color: var(--red); font-weight: 600; font-size: .78rem; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 56px; gap: .6rem; align-items: center; font-size: .85rem; margin: .35rem 0; } .bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.meter { height: 8px; background: var(--paper-2); border-radius: 4px; overflow: hidden; display: block; } .meter span { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.inline-bar { display: block; height: 3px; background: var(--orange); opacity: .5; border-radius: 2px; margin-top: 3px; }
ol.rank { margin: 0; padding-left: 1.4em; font-size: .88rem; } ol.rank li { padding: .25rem 0; border-bottom: 1px dashed var(--line); } ol.rank li { display: list-item; }
ol.rank li > b { float: right; font-variant-numeric: tabular-nums; margin-left: .6rem; } ol.rank li a { color: var(--ink); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .3rem; } .tag-cloud .dim { opacity: .7; }
@media (max-width: 640px) { .stats-grid, .stats-grid.three { grid-template-columns: 1fr; } .bar-row { grid-template-columns: 110px 1fr 48px; } }
