html{-webkit-text-size-adjust:100%}
body{font:14px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:#f2f6fd linear-gradient(180deg,#d6e4fa 0,#f2f6fd 240px);color:#1f2937;margin:0 auto;padding:6px 10px 20px;max-width:980px;min-height:100vh;text-align:center}
a{color:#1d4ed8;text-decoration:none}a:hover{text-decoration:underline}
#top{border-bottom:1px solid #b9cbe8;padding:6px 0;margin-bottom:10px;line-height:1.9}#top a{margin:0 3px}
#logo{text-align:center;margin:14px 0 8px}#logo img{width:84px;max-width:40%;height:auto;mix-blend-mode:multiply;display:block;margin:0 auto 4px}#logo h1{font:bold 28px system-ui,Arial,sans-serif;margin:0;color:#0f172a}#logo i{color:#475569}
h2{font-size:16px;margin:16px auto 6px;border-bottom:1px solid #b9cbe8;padding-bottom:3px;text-align:center}
table{border-collapse:collapse;background:#fff;margin:6px auto}td,th{border:1px solid #c5d3ea;padding:3px 8px;font-size:13px;text-align:center}
input,textarea,select,button{font:13px system-ui,Arial,sans-serif;border:1px solid #9fb3d4;border-radius:4px;background:#fff;color:#111;padding:3px 6px}button{background:#e4ecfa;padding:3px 10px;cursor:pointer}button:hover{background:#d3e0f7}
.pf{margin:6px auto}.pf td{border:0;text-align:left}.pf td:first-child{background:#d6e2f7;font-weight:bold;border:1px solid #bccae6;text-align:center}
.post{display:block;box-sizing:border-box;width:min(100%,760px);background:#dfe8f8;border:1px solid #bccae6;border-radius:4px;padding:5px 8px;margin:5px auto;text-align:left;overflow:hidden}.post.op{background:rgba(255,255,255,.65);border:1px solid #cfdaf0}
.post:target{background:#ffe6bf}.nm{color:#117743}.own{background:#8b0000;color:#fff;padding:0 4px;font-size:11px;font-weight:bold;border-radius:2px}
.meta{font-size:12px;color:#334155}.subj{color:#1e3a8a;font-weight:bold}.gt{color:#6b8e23}.q{color:#d00}
.sp{background:#000;color:#000}.sp:hover{color:#fff}.th{max-width:200px;max-height:200px;float:left;margin:3px 10px 3px 0;border:1px solid #9fb3d4;border-radius:3px}
.spoil{filter:blur(14px)}.spoil:hover{filter:none}.pend{color:#a00;font-size:11px;margin-right:8px}
.body{margin:4px 0 4px 4px;overflow-wrap:anywhere;text-align:left}.clr{clear:both}hr{border:0;border-top:1px solid #b9cbe8;margin:12px auto;max-width:760px}
.cat{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.cat div{width:150px;max-height:230px;overflow:hidden;text-align:center;font-size:12px;background:#fff;border:1px solid #c5d3ea;border-radius:4px;padding:4px}
.cat img{max-width:140px;max-height:140px}.lk{background:none;border:0;color:#1d4ed8;padding:0;cursor:pointer;font-size:12px}.lk:hover{background:none;text-decoration:underline}.inl{display:inline}
.err{border:1px solid #a00;background:#fee;padding:8px 12px;border-radius:4px;display:inline-block}.foot{text-align:center;color:#64748b;font-size:12px;margin-top:24px}
#pv{max-width:760px;margin:6px auto}
@media(max-width:600px){textarea{width:95%}input[type=text],input:not([type]){width:90%}button,input,select{min-height:32px}.th{max-width:120px}table{display:block;overflow-x:auto}}

body.dark{background:#0d0d0d;color:#ccc}.dark a{color:#6db3f2}.dark #top,.dark h2{border-color:#444}.dark #logo h1{color:#fff}
.dark table,.dark td,.dark th{background:#161616;border-color:#444;color:#ccc}
.dark .pf td{background:none;border:0}.dark .pf td:first-child{background:#222;border:1px solid #444}
.dark input,.dark textarea,.dark select,.dark button{background:#1c1c1c;color:#ddd;border-color:#555}.dark button:hover{background:#262626}
.dark .post{background:#1a1a1a;border-color:#333}.dark .post.op{background:none;border-color:transparent}.dark .post:target{background:#3a2418}
.dark .nm{color:#4caf7a}.dark .subj{color:#9fb4ff}.dark .meta{color:#aaa}.dark .gt{color:#8fb339}.dark .q{color:#ff6b6b}
.dark .lk{background:none;color:#6db3f2}.dark hr{border-top-color:#333}.dark .cat div{background:#161616;border-color:#444}.dark .th{border-color:#555}
.dark .err{background:#2a1010;border-color:#a33}.dark .foot{color:#777}.dark .sp{background:#ccc;color:#ccc}.dark .sp:hover{color:#000}.dark .pend{color:#e66}

/* Blajak media preview update */
.th{width:auto;max-width:112px;max-height:112px;object-fit:contain;cursor:zoom-in}
.media-preview{display:inline-block;max-width:116px;max-height:116px;vertical-align:top}
.media-state{display:inline-block;max-width:116px;max-height:116px;margin:3px 10px 3px 0;vertical-align:top}
.media-state img{display:block;width:112px;height:auto;max-height:112px;object-fit:contain}
.admin-media-thumb{display:block;width:76px;height:76px;object-fit:contain;cursor:zoom-in}
@media(max-width:600px){.th,.media-state img{max-width:88px;max-height:88px}.media-preview,.media-state{max-width:92px;max-height:92px}}

/* Click-to-enlarge media lightbox (stays on the same page) */
.media-preview{cursor:zoom-in}
.admin-media-thumb{cursor:zoom-in}
.media-enlarge[hidden]{display:none!important}
.media-enlarge{position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,.88);display:flex;align-items:center;justify-content:center;padding:4vh 3vw;box-sizing:border-box;cursor:zoom-out}
.media-enlarge img{display:block;max-width:94vw;max-height:92vh;width:auto;height:auto;object-fit:contain;box-shadow:0 4px 30px rgba(0,0,0,.55);cursor:default}
.media-enlarge-close{position:absolute;top:12px;right:16px;border:0;border-radius:6px;background:#fff;color:#111;font-size:30px;line-height:1;padding:3px 12px;cursor:pointer}
body.media-enlarge-open{overflow:hidden}

/* Homepage media thumbnails and same-page lightbox */
.home-media-zoom{display:inline-block;max-width:190px;max-height:190px;width:auto;height:auto;object-fit:contain;vertical-align:middle;margin:5px 7px;border:1px solid #999;border-radius:5px;cursor:zoom-in}
.home-media-zoom:hover{box-shadow:0 2px 10px #0003}
.media-lightbox{position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,.88);display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box;cursor:zoom-out}
.media-lightbox img{max-width: min(96vw,1600px);max-height:92vh;width:auto;height:auto;object-fit:contain;box-shadow:0 4px 30px #0008}
.media-lightbox button{position:absolute;top:12px;right:16px;font-size:28px;padding:4px 12px;color:#fff;background:#222;border:1px solid #aaa;border-radius:6px;cursor:pointer}
@media(max-width:600px){.home-media-zoom{max-width:42vw;max-height:180px}.media-lightbox{padding:10px}}

/* Larger thread images */
.thread-image,
.post-image,
.thread img,
.post img {
    max-width: 100%;
    width: auto;
    max-height: 700px;
    height: auto;
    object-fit: contain;
}

/* Larger site header logo */
.site-logo,
header img,
.logo img {
    max-height: 160px;
    width: auto;
    object-fit: contain;
}

/* Force larger site logo */
header .logo,
header .logo img,
.logo,
.logo img,
.site-logo,
.site-logo img,
#logo,
#logo img,
header img {
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    max-width: 100% !important;
}

header .logo img,
.logo img,
.site-logo img,
#logo img {
    height: 180px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* Disable spoiler image blur */
.spoil,
img.spoil,
.spoiler img {
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
}
