@font-face {
  font-family: 'Google Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/google-sans:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
}
:root {
    --bg: #080808;
    --fg: #bbb;
    --nav-bg: #111;
    --nav-border: #222;
    --panel-bg: #151515;
    --panel-border: #222;
    --panel-alt: rgba(16,16,16,.85);
    --accent: #f9e2af;
    --accent-rgb: 249, 226, 175;
    --green: #6a6;
    /* old accent: #f9e2af */
    --dim: #555;
    --faint: #444;
    --line: #222;
    --line2: #181818;
    --hl-bg: #111;
    --input-bg: #111;
    --input-border: #222;
    --input-fg: #bbb;
    --bar-bg: #141414;
    --upload-border: #333;
    --thumb-bg: #000;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Google Sans Variable', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    line-height: 1.5;
    overflow-x: hidden;
    transition: background .2s, color .2s;
}
h1, h2, h3, h4, h5, h6 { font-weight: 500; color: var(--accent); }
.hero-title, .sec, .card-name, .nav .host, .menu-section-title, .panel .hdr,
.post-item .ptitle, .post-full .ptitle, .comment-box .cmt-user, .fi-hdr,
.stat, .gb-name, .btn, .tab-bar button, .counter-txt { font-weight: 500; }

#stars {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background .2s, border-color .2s;
}
.nav .host { color: var(--accent); font-weight: bold; font-size: 13px; }
.nav .loc { color: var(--dim); }
.nav a {
    color: var(--accent);
    text-decoration: none;
    margin-left: 8px;
    font-size: 12px;
    letter-spacing: 0.5px;
    transition: opacity .15s;
    cursor: pointer;
}
.nav a:hover { opacity: .7; }
.nav .right { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.nav-menu-wrap { position: relative; }
.menu-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: var(--panel-bg); border: 1px solid var(--panel-border);
    min-width: 160px; padding: 4px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    z-index: 9999;
    animation: fadeIn .1s;
}
.menu-section { padding: 4px 0; }
.menu-section + .menu-section { border-top: 1px solid var(--line); }
.menu-section-title {
    font-size: 9px; text-transform: lowercase; letter-spacing: 1px;
    color: var(--dim); padding: 4px 14px 2px; cursor: default;
}
.menu-toggle { cursor: pointer; user-select:none; }
.menu-toggle:hover { color: var(--accent); }
.menu-sub { }
.menu-dropdown a, .menu-dropdown button {
    display: block; width: 100%; text-align: left; padding: 6px 14px;
    color: var(--fg); text-decoration: none; font-size: 12px;
    background: none; border: none; font-family: inherit; cursor: pointer;
    margin: 0; transition: background .1s;
}
.menu-dropdown a:hover, .menu-dropdown button:hover { background: var(--hl-bg); color: var(--accent); }
.menu-dropdown a svg { color: var(--accent); stroke: var(--accent); vertical-align: middle; margin-right: 2px; filter: saturate(2); }
.menu-dropdown .menu-accent { color: var(--accent); font-size: 10px; }
.menu-dropdown .menu-link { color: var(--accent); }

.hero {
    text-align: center;
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
}
.hero-title {
    font-size: 28px;
    color: var(--accent);
    font-weight: bold;
    letter-spacing: 4px;
}
.hero-sub {
    font-size: 11px;
    color: var(--faint);
    text-transform: lowercase;
    letter-spacing: 3px;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .wrap { padding: 16px 10px 16px 8px; }
}

.sec {
    font-size: 11px;
    text-transform: lowercase;
    letter-spacing: 2px;
    color: var(--faint);
    margin: 20px 0 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
@media (max-width: 600px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
    display: block;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 16px;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.card:hover { border-color: var(--accent); background: rgba(var(--accent-rgb),.03); }
.card-icon {
    font-size: 18px;
    color: var(--dim);
    margin-bottom: 6px;
}
.card-name {
    font-size: 14px;
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 2px;
}
.card-desc {
    font-size: 11px;
    color: var(--dim);
}

.ls { list-style: none; margin-bottom: 20px; }
.ls li { border-bottom: 1px solid var(--line); }
.ls li:last-child { border: none; }
.ls a {
    display: block;
    padding: 8px 12px;
    color: var(--fg);
    text-decoration: none;
    transition: background .1s;
}
.ls a:hover { background: var(--hl-bg); }
.ls .icon { display: inline-block; vertical-align: middle; margin-right: 6px; }
.ls .icon svg { color: var(--accent); stroke: var(--accent); filter: saturate(2); }
.ls .icon img { display: block; border-radius: 3px; }
.ls .name { color: var(--accent); font-weight: bold; }
.ls .desc { color: var(--dim); font-size: 11px; margin-left: 6px; }
.ls .meta { color: var(--faint); font-size: 11px; float: right; }
.ls.sub { margin: 0 0 0 20px; }
.ls.sub li { border: none; }
.ls.sub a { padding: 4px 12px; }
.ls.alt li:nth-child(even) { background: rgba(255,255,255,.03); }
.ls.alt li:nth-child(odd) { background: rgba(255,255,255,.01); }

.fi { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line2); gap: 12px; }
.fi:nth-child(even) { background: rgba(255,255,255,.02); }
.fi:hover { background: var(--hl-bg); }
.fi-hdr { color: var(--faint); font-size: 10px; text-transform: lowercase; letter-spacing: 1px; }
.fi .fn { color: var(--accent); text-decoration: none; font-size: 12px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi .fn:hover { opacity: .85; }
.fi .fn.dir { color: var(--accent); }
.fi .fi-meta { display: flex; align-items: center; flex: 0 0 auto; margin-left: auto; text-align: right; }
.fi .raw-btn { color: var(--accent); font-size: 11px; text-decoration: none; display: inline-block; white-space: nowrap; }
.fi .raw-btn:hover { opacity: .7; }
.fi .raw-btn-placeholder { display: inline-block; width: 36px; flex-shrink: 0; }
.fi .fsize { color: var(--dim); font-size: 11px; display: inline-block; width: 70px; text-align: right; }
.fi .fdate { color: var(--dim); font-size: 10px; display: inline-block; width: 80px; text-align: right; }
.fi .fttl { display: inline-block; width: 70px; text-align: right; }
.fi .ttl { color: var(--accent); font-size: 10px; }
.fi-thumb { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--panel-border); background: var(--thumb-bg); flex-shrink: 0; transition: background .2s; }
.fi-thumb-placeholder { width: 40px; flex-shrink: 0; }
.fi-header { display: flex; justify-content: space-between; padding: 4px 10px; font-size: 10px; color: var(--faint); text-transform: lowercase; letter-spacing: 1px; border-bottom: 1px solid var(--line); }

.term {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 12px 16px;
    margin: 12px 0;
    font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    transition: background .2s, border-color .2s;
}
.term .line { margin-bottom: 1px; }
.term .ps1 { color: var(--accent); }
.term .out { color: var(--dim); }
.term a { color: var(--faint); text-decoration: none; }
.term a:hover { color: var(--accent); }
.hero-term {
    border: none;
    border-left: 2px solid var(--accent);
    background: var(--panel-bg);
    padding: 16px 20px;
    margin: 0 0 24px 0;
    font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}
.hero-term .ps1 { color: var(--accent); }
.hero-term .out { color: var(--dim); }
.err { color: #f38ba8; font-size: 12px; }
.loading { color: var(--faint); font-size: 12px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.panel { background: var(--panel-bg); border: 1px solid var(--panel-border); padding: 16px; transition: background .2s, border-color .2s; }
.panel.fw { grid-column: 1 / -1; }
.panel.fw2 { grid-column: span 2; }
.panel .hdr {
    font-size: 10px; text-transform: lowercase; letter-spacing: 2px;
    color: #333; padding-bottom: 6px; border-bottom: 1px solid #181818; margin-bottom: 10px;
}

.stat { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; }
.stat .v { color: var(--dim); }
.stat .dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; }
.stat .dot.on { background: var(--green); }
.stat .dot.off { background: var(--faint); }

.bar-bg { background: var(--bar-bg); height: 8px; margin: 4px 0 8px; overflow: hidden; transition: background .2s; }
.bar-fill { height: 100%; transition: width 1s; }
.bar-fill.ok { background: var(--green); opacity: .6; }
.bar-fill.warn { background: var(--accent); }
.bar-fill.bad { background: #f77; }

html { height: 100vh; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}
.wrap { flex: 1 0 auto; max-width: 960px; width: 100%; margin: 0 auto; padding: 40px 64px; position: relative; z-index: 1; }
.wrap-wide { max-width: none; }
.counter { text-align: center; margin-top: 8px; }
.c-digit { vertical-align: middle; image-rendering: pixelated; }
.counter .c-digit + .c-digit { margin-left: 2px; }
.counter-txt { margin-top: 6px; font-size: 11px; color: #666; }
.footer {
    border-top: 1px solid var(--nav-border);
    padding: 12px 24px;
    font-size: 11px;
    text-align: left;
    color: var(--accent);
    flex-shrink: 0;
    background: var(--nav-bg);
    transition: background .2s, border-color .2s;
}
.footer .fp { color: var(--faint); }
.footer a {
    color: var(--accent);
    text-decoration: none;
}
.footer a:hover { opacity: .7; }

.dosbox-wrap { width: 100%; aspect-ratio: 4/3; background: #000; border: 1px solid #222; }
.dosbox-wrap canvas { width: 100%; height: 100%; display: block; }
.controls { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn {
    background: var(--panel-bg); border: 1px solid var(--accent);
    color: var(--accent); padding: 6px 14px; font-family: inherit; font-size: 12px; cursor: pointer;
    transition: background .15s;
}
.btn:hover { background: rgba(var(--accent-rgb),.1); }
.thing-btn {
    display: inline-block;
    font-size: 28px;
    margin: 12px 0;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}
.thing-btn:hover { color: #fff; }
#thing_section { width: 100%; text-align: center; }
#thing_section .sec { text-align: left; }
.hint kbd { background: var(--panel-bg); border: 1px solid var(--input-border); padding: 1px 5px; font-family: inherit; font-size: 11px; color: var(--dim); }

.upload-area {
    border: 1px dashed var(--upload-border); padding: 14px; text-align: center;
    font-size: 12px; color: var(--dim); cursor: pointer; margin-bottom: 8px;
    transition: border-color .2s, background .2s;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); background: rgba(var(--accent-rgb),.03); }

.file-list { list-style: none; }
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--line2);
}
.file-item:nth-child(even) { background: rgba(255,255,255,.015); }
.file-item:hover { background: var(--hl-bg); }
.file-item .fn { color: var(--accent); text-decoration: none; font-size: 12px; }
.file-item .fn:hover { opacity: .7; }
.file-item .fn.dir { color: var(--accent); }
.file-item .fsize { color: var(--faint); font-size: 11px; }
.file-item .fmtime { color: var(--faint); font-size: 10px; margin-left: 8px; }
.file-item .raw-link { margin-left: 8px; display: inline; }
.file-item .raw-link a { color: var(--faint); font-size: 10px; text-decoration: none; }
.file-item .raw-link a:hover { color: var(--accent); }

input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 12px; height: 12px;
    border: 1px solid var(--input-border); background: var(--input-bg);
    cursor: pointer; flex-shrink: 0;
    position: relative;
    transition: background .15s, border-color .15s;
}
input[type="checkbox"]:checked {
    background: var(--accent); border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    width: 4px; height: 7px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: border-color .15s;
}
input[type="checkbox"]:focus { outline: none; border-color: var(--accent); }

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .7; }

@media (max-width: 600px) {
    .grid2 { grid-template-columns: 1fr; }
    .panel.fw2 { grid-column: span 1; }
    .wrap { padding: 16px 10px 16px 8px; }
    .nav { flex-wrap: wrap; gap: 4px; }
    .ls .meta { float: none; margin-left: 6px; }

    /* CDN file list mobile */
    .fi { flex-wrap: wrap; padding: 8px 8px; gap: 4px; }
    .fi .fn { font-size: 11px; min-width: 120px; flex: 0 1 100%; }
    .fi .fi-meta { flex-wrap: wrap; gap: 2px; width: 100%; margin-left: 0; }
    .fi .fsize, .fi .fdate, .fi .fttl { width: auto; font-size: 9px; }
    .fi .fdate { width: 60px; }
    .fi-thumb { width: 28px; height: 28px; }
    .fi-thumb-placeholder { width: 28px; }
    .fi-hdr .fn { display: none; }
    .fi-hdr .fi-meta { width: 100%; }
    .cdn-toolbar { flex-wrap: wrap; }
}

input:not([type="checkbox"]):not([type="file"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--input-fg) !important;
    transition: background .2s, border-color .2s, color .2s !important;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.ani-fade-in { animation: fadeIn .3s ease both; }
.ani-slide-up { animation: fadeSlideUp .35s ease both; }

/* board — twitter-style layout */
.board-wrap { max-width: 900px; }
.tab-bar { display: flex; gap: 0; margin-bottom: 12px; border-bottom: 1px solid #222; }
.tab-bar button { background: none; border: none; border-bottom: 2px solid transparent; color: #555; padding: 6px 14px; font-family: inherit; font-size: 12px; cursor: pointer; }
.tab-bar button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-bar button:hover { color: var(--accent); }
#form_area { display: none; }

.post-item { display:flex; gap:6px; background:rgba(16,16,16,.85); border:1px solid #222; padding:12px 14px; margin-bottom:8px; cursor:pointer; color:inherit; text-decoration:none; }
.post-item:hover { border-color:var(--accent); }

.p-av-col { flex:0 0 40px; width:40px; }
.p-av, .p-av-ph { width:36px; height:36px; object-fit:cover; background:#111; display:flex; align-items:center; justify-content:center; font-size:14px; color:var(--accent); font-weight:bold; border:2px solid #333; flex-shrink:0; }
.p-av-ph { color:var(--accent); }
.p-av-lg { width:44px; height:44px; font-size:18px; border-width:2px; }

.p-body-col { flex:1; min-width:0; }
.p-head { display:flex; align-items:center; gap:4px; flex-wrap:wrap; margin-bottom:2px; }
.p-name { font-weight:bold; font-size:13px; cursor:pointer; color:var(--accent); }
.p-name:hover { opacity:.7; }
.p-time { font-size:10px; color:#444; margin-left:auto; white-space:nowrap; }

.post-item .ptitle { font-size:14px; color:var(--accent); margin-bottom:2px; overflow-wrap:anywhere; }
.post-item .pexcerpt { font-size:12px; color:#777; line-height:1.4; overflow-wrap:anywhere; }
.p-reply-indicator { font-size:11px; color:#666; margin:2px 0 6px; }
.p-reply-indicator span { color:#f9e2af; cursor:pointer; }
.p-reply-indicator span:hover { text-decoration:underline; }
.p-parent-link { font-size:11px; color:#666; margin:4px 0; }
.p-parent-link a { color:#89b4fa; }
.reply-item { display:flex; gap:10px; padding:10px 0; border-bottom:1px solid #181818; }
.reply-item:last-child { border-bottom:none; }
.r-av, .r-av-ph { width:28px; height:28px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.r-av-ph { background:#222; color:#555; display:flex; align-items:center; justify-content:center; font-size:11px; }
.post-item .pimg { display:block; max-width:100%; max-height:200px; width:auto; height:auto; margin-top:8px; border:1px solid #222; object-fit:contain; }

.p-actions { display:flex; gap:4px; margin-top:6px; align-items:center; }

.pv-action { color:#444; font-size:11px; cursor:pointer; font-family:inherit; background:none; border:none; padding:4px 8px; display:inline-flex; align-items:center; gap:3px; }
.pv-action svg { width:14px; height:14px; }
.pv-action:first-child { padding-left:0; }
.pv-action:hover { color:var(--accent); }
.pv-like { color:#6a6; }
.p-tower { font-family:inherit; font-weight:bold; }
.p-tower sup { font-size:0.7em; }
.pv-dis { color:#a66; }
.pv-comment { color:#555; }
.v-on { color:var(--accent) !important; }
.v-on .pv-icon { color:var(--accent) !important; }

/* post view */
.post-full { display:flex; gap:10px; background:rgba(16,16,16,.85); border:1px solid #222; padding:18px; position:relative; }
.post-full .p-av-col { flex:0 0 44px; width:44px; }
.post-full .ptitle { font-size:16px; color:var(--accent); margin-bottom:2px; overflow-wrap:anywhere; }
.post-full .pbody { font-size:13px; color:#999; line-height:1.6; margin-top:6px; overflow-wrap:anywhere; }
.post-full .pimg-full { max-width:100%; max-height:80vh; width:auto; height:auto; margin-top:8px; border:1px solid #222; object-fit:contain; }

/* comments — twitter-style */
.comment-box { display:flex; gap:6px; padding:10px 12px; font-size:12px; background:rgba(16,16,16,.85); border:1px solid #222; margin-bottom:6px; }
.c-av-col { flex:0 0 32px; width:32px; }
.c-av, .c-av-ph { width:28px; height:28px; object-fit:cover; background:#111; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:bold; border:2px solid #333; flex-shrink:0; }
.c-av-ph { color:var(--accent); }
.c-body-col { flex:1; min-width:0; overflow-wrap:anywhere; }
.c-head { display:flex; align-items:center; gap:4px; flex-wrap:wrap; margin-bottom:2px; }
.c-name { font-weight:bold; font-size:12px; cursor:pointer; color:var(--accent); }
.c-name:hover { opacity:.7; }
.c-time { color:#333; font-size:10px; margin-left:auto; white-space:nowrap; }
.comment-box .cmt-body { color:#999; line-height:1.5; margin:2px 0 4px; overflow-wrap:anywhere; }
.comment-box .cmt-actions { display:flex; gap:4px; align-items:center; margin-top:2px; flex-wrap:wrap; }

/* upload */
#upload_area { border: 1px dashed #333; padding: 80px 20px; text-align: center; font-size: 13px; color: #666; cursor: pointer; margin-bottom: 12px; transition: border-color .2s, background .2s; }
#upload_file_list input::placeholder { color: #444; font-style: italic; }
#upload_area:hover, #upload_area.dragover { border-color: var(--accent); background: rgba(var(--accent-rgb),.03); }
#upload_file_list .fi { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #181818; }
#upload_file_list .fi:nth-child(even) { background: rgba(255,255,255,.015); }
#upload_file_list .fi .fn { color: var(--accent); font-size: 12px; text-decoration: none; }
#upload_file_list .fi .fn:hover { opacity: .7; }

#upload_progress_bar { background: var(--accent) !important; }

/* badges */
.pf-badges { display:flex; gap:4px; flex-wrap:wrap; align-items:center; }
.pf-badge { font-size:9px; padding:0 3px; font-weight:normal; text-transform:lowercase; letter-spacing:.3px; margin-left:2px; vertical-align:middle; display:inline-block; color:#555; }
.pf-badge-mod { color:#665e4a; }
.pf-badge-admin { color:#663d3d; }
.pf-badge-dev { color:#3d5666; }
.pf-badge-early { color:#4d6640; }
.pf-badge-op { color:#553d66; }

/* image grid — discord-like */
.pimg-single { margin-top:8px; max-width:300px; display:inline-block; }
.pimg-single img { width:100%; height:auto; border:1px solid #222; border-radius:4px; cursor:pointer; display:block; }
.pimg-grid { display:grid; gap:4px; margin-top:8px; }
.pimg-grid img { width:100%; height:100%; object-fit:cover; border:1px solid #222; border-radius:4px; cursor:pointer; transition:opacity .15s; }
.pimg-grid img:hover { opacity:.7; }

.pimg-c2 { grid-template-columns:1fr 1fr; max-width:200px; aspect-ratio:2/1; }
.pimg-c3 { grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; max-width:300px; aspect-ratio:1/1; }
.pimg-c3 > :nth-child(1) { grid-row:1/3; }
.pimg-c4 { grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; max-width:260px; aspect-ratio:1/1; }
.pimg-c5 { grid-template-columns:1fr 1fr 1fr; grid-template-rows:1fr 1fr; max-width:360px; aspect-ratio:3/2; }
.pimg-c5 > :nth-child(4) { grid-column:1/3; }
.pimg-c6 { grid-template-columns:1fr 1fr 1fr; grid-template-rows:1fr 1fr; max-width:360px; aspect-ratio:3/2; }
.pimg-c7 { grid-template-columns:repeat(4,1fr); max-width:400px; aspect-ratio:4/2; }
.pimg-c8 { grid-template-columns:repeat(4,1fr); grid-template-rows:1fr 1fr; max-width:400px; aspect-ratio:4/2; }
.pimg-c9 { grid-template-columns:repeat(3,1fr); grid-template-rows:1fr 1fr 1fr; max-width:360px; aspect-ratio:1/1; }
.pimg-c10 { grid-template-columns:repeat(5,1fr); grid-template-rows:1fr 1fr; max-width:450px; aspect-ratio:10/2; }

/* full post view — wider grid */
.pimg-grid-full { display:grid; gap:4px; margin-top:8px; }
.pimg-grid-full img { width:100%; height:100%; object-fit:cover; border:1px solid #222; border-radius:4px; cursor:pointer; transition:opacity .15s; }
.pimg-grid-full img:hover { opacity:.7; }
.pimg-grid-full:has(> :nth-child(1):last-child) { grid-template-columns:1fr; max-width:500px; }
.pimg-grid-full:has(> :nth-child(1):last-child) img { aspect-ratio:auto; max-height:500px; width:auto; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(2)) { grid-template-columns:1fr 1fr; max-width:400px; aspect-ratio:2/1; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(3)) { grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; max-width:500px; aspect-ratio:1/1; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(3)) > :nth-child(1) { grid-row:1/3; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(4)) { grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; max-width:500px; aspect-ratio:1/1; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(5)) { grid-template-columns:1fr 1fr 1fr; grid-template-rows:1fr 1fr; max-width:600px; aspect-ratio:3/2; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(5)) > :nth-child(4) { grid-column:1/3; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(6)) { grid-template-columns:1fr 1fr 1fr; grid-template-rows:1fr 1fr; max-width:600px; aspect-ratio:3/2; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(7)) { grid-template-columns:repeat(4,1fr); max-width:600px; aspect-ratio:4/2; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(8)) { grid-template-columns:repeat(4,1fr); grid-template-rows:1fr 1fr; max-width:600px; aspect-ratio:4/2; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(9)) { grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(3,1fr); max-width:600px; aspect-ratio:1/1; }
.pimg-grid-full:has(> :nth-child(1):nth-last-child(10)) { grid-template-columns:repeat(5,1fr); grid-template-rows:1fr 1fr; max-width:650px; aspect-ratio:10/2; }

/* gallery overlay */
.gallery-overlay { position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.92);z-index:9999;display:flex;align-items:center;justify-content:center;cursor:pointer; }
.gallery-img { max-width:90%;max-height:90%;object-fit:contain;cursor:default;border-radius:4px; }
.gallery-count { position:fixed;bottom:20px;left:50%;transform:translateX(-50%);color:#888;font-size:12px;background:rgba(0,0,0,0.6);padding:4px 12px;border-radius:10px; }
.gallery-close { position:fixed;top:12px;right:16px;cursor:pointer;color:var(--accent);width:28px;height:28px;stroke-width:2.5;transition:opacity .15s; }
.gallery-close:hover { opacity:.7; }
.gallery-nav { position:fixed;top:50%;transform:translateY(-50%);cursor:pointer;color:var(--accent);width:40px;height:40px;stroke-width:2.5;padding:8px;transition:opacity .15s;border-radius:4px; }
.gallery-nav:hover { opacity:.7;background:rgba(255,255,255,.05); }
.gallery-prev { left:12px; }
.gallery-next { right:12px; }
