:root {
  --bg: #090a0f; --panel: rgba(18, 19, 25, .92); --side: rgba(13, 14, 19, .92); --line: #23252f;
  --text: #d4d7e2; --mute: #7b8094; --blue: #7d9bff; --blue-d: #3d5bd9; --err: #ff7a8a; --ok: #74e0a8;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text);
  background: radial-gradient(ellipse 80% 50% at 50% 0, #111a38 0, var(--bg) 70%) fixed var(--bg);
  font: 13px/1.6 "JetBrains Mono", ui-monospace, Consolas, monospace;
}
#stars { position: fixed; inset: 0; z-index: -1; pointer-events: none }
a { color: var(--blue); text-decoration: none } a:hover { text-decoration: underline }
.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 16px }

header { position: sticky; top: 0; z-index: 5; background: rgba(9, 10, 15, .8); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line) }
.nav { display: flex; align-items: center; gap: 32px; min-height: 54px }
.logo { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: 1px; text-shadow: 0 0 18px rgba(125, 155, 255, .45) }
.logo span { color: var(--blue) } .logo:hover { text-decoration: none }
.logo { display: flex; align-items: center; gap: 8px } .logo .lw { color: #fff } .logo img { filter: drop-shadow(0 0 6px rgba(125, 155, 255, .6)) }
.links { display: flex; align-items: center; gap: 20px }
.links a { color: var(--mute) } .links a:hover, .links a.on { color: var(--blue); text-decoration: none }
#user { margin-left: auto } #user b { color: #fff; font-weight: 600 }
main { flex: 1; padding-top: 28px; padding-bottom: 48px }
footer { border-top: 1px solid var(--line); font-size: 11px; color: var(--mute) }
.foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px }
.foot a { color: var(--mute); margin-left: 14px }

h1 { margin: 0 0 16px; font-size: 20px; font-weight: 600; color: #fff }
.c { text-align: center } .mute { color: var(--mute) } .small { font-size: 11px }
.pad { padding: 12px 14px } .sep { border-top: 1px solid var(--line) } .right { text-align: right; margin-top: 10px }
.banner { border: 1px solid var(--line); background: var(--panel); padding: 10px 14px; border-radius: 6px; margin-bottom: 20px }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px }
.crumb { margin-bottom: 6px; font-size: 11px }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; align-items: start }

.box { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .35) }
.box-h { padding: 10px 14px; color: var(--blue); font-weight: 600; border-bottom: 1px solid var(--blue-d) }
.row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 64px 64px 210px; gap: 14px; align-items: center; padding: 14px; color: var(--text); border-top: 1px solid var(--line) }
.box-h + .row, .box > .row:first-child { border-top: 0 }
.row:hover { background: rgba(125, 155, 255, .05); text-decoration: none }
.trow { grid-template-columns: minmax(0, 1fr) 64px 150px }
.title { color: #fff; font-size: 14px }
.num { text-align: center } .num small { display: block; color: var(--mute); font-size: 10px }
.last { min-width: 0 } .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.ico { width: 26px; height: 26px; color: var(--mute) } .row:hover .ico { color: var(--blue) }
.kv { display: flex; justify-content: space-between }

.shouts { height: 260px; overflow-y: auto; padding: 10px 14px; word-break: break-word }
.shouts b { color: var(--blue); font-weight: 600 }
.shouts .sys { color: var(--mute); font-size: 12px; border-left: 2px solid var(--line); padding-left: 8px; margin: 4px 0 }
.shouts .hl { background: rgba(61, 91, 217, .14); border-left: 2px solid #7d9bff; margin: 0 -14px; padding: 0 12px }
.mention { color: #7d9bff } .mention.me { background: rgba(125, 155, 255, .18); border-radius: 3px; padding: 0 2px }
.shout-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line) }

input, textarea { width: 100%; background: #0d0e13; color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px; font: inherit }
input[type=checkbox] { width: auto; accent-color: var(--blue) }
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(125, 155, 255, .15) }
textarea { resize: vertical }
.btn { display: inline-block; background: #1a1c24; color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 7px 16px; font: inherit; cursor: pointer; white-space: nowrap }
.btn:hover { border-color: #343849; text-decoration: none }
.btn.p { background: #1c2a52; border-color: #2f4687; color: #d7e1ff }
.btn.p:hover { background: #233467; box-shadow: 0 0 14px rgba(125, 155, 255, .35) }
.btn:disabled { opacity: .5; cursor: default }
.stack { display: grid; gap: 10px }

.form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); margin-bottom: 14px }
.form .l { padding: 20px 12px 0; text-align: right; color: var(--mute); background: var(--side) }
.form .l small { display: block; font-size: 10px; color: #6b6f80 }
.form .f { padding: 12px; border-left: 1px solid var(--line) }
.form .f > small { display: block; margin-top: 4px }
.actions { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 8px 12px 8px calc(100% / 3 + 12px) }
.pw { display: flex } .pw input { border-radius: 4px 0 0 4px } .pw .btn { border-radius: 0 4px 4px 0; border-left: 0 }
.chk { display: flex; gap: 8px; align-items: center }
.msg { margin-top: 8px } .msg:empty { display: none } .err { color: var(--err) } .ok { color: var(--ok) }

.post { display: grid; grid-template-columns: 170px minmax(0, 1fr) }
.who { padding: 16px; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center }
.avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2b3f86, #141c3a); color: #cfdaff; font-weight: 700; text-transform: uppercase; box-shadow: 0 0 14px rgba(125, 155, 255, .25) }
.tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--mute) }
.tag.admin { color: var(--blue); border-color: var(--blue-d) }
.tag.alpha { color: #ffa94d; border-color: #b8621b; box-shadow: 0 0 8px rgba(255, 140, 40, .35) }
.tag.admin { box-shadow: 0 0 8px rgba(110, 150, 255, .35) }
.name { white-space: nowrap }
.name.banned { text-decoration: line-through 3px #000; opacity: .75 }
.name.premium { color: #ffd166; text-shadow: 0 0 6px rgba(255, 209, 102, .7), 0 0 14px rgba(255, 190, 60, .35) }
.name.lifetime { color: #d29bff; text-shadow: 0 0 6px rgba(190, 120, 255, .85), 0 0 16px rgba(170, 90, 255, .45) }
.name.moderator { color: #5eead4; text-shadow: 0 0 6px rgba(60, 230, 200, .8), 0 0 16px rgba(40, 210, 180, .4) }
.name.moderator::before { content: "◆ "; font-size: .8em }
.tag.premium { color: #ffd166; border-color: #9c7a22 }
.tag.lifetime { color: #d29bff; border-color: #7a3fc0 }
.tag.moderator { color: #5eead4; border-color: #1f8f7f }
.tag.banned, .tag.denied { color: var(--err); border-color: #8a2f3b }
.tag.open, .tag.accepted { color: var(--ok); border-color: #2c7a54 }
.tag.pin, .tag.lock { color: var(--blue); border-color: var(--blue-d); font-size: 9px; vertical-align: 2px }
.name.alpha { color: #ffa94d; text-shadow: 0 0 6px rgba(255, 140, 40, .85), 0 0 16px rgba(255, 110, 20, .45) }
.name.admin { color: #9db8ff; text-shadow: 0 0 6px rgba(110, 150, 255, .9), 0 0 16px rgba(80, 120, 255, .5) }
.name.admin::before { content: "★ "; color: #cfdcff }
.x { background: none; border: 0; color: var(--mute); cursor: pointer; font: inherit; padding: 0 4px }
.x:hover { color: var(--err) }
.btn.sm { padding: 3px 10px; font-size: 11px }
.btn.danger:hover:not(:disabled) { border-color: var(--err); color: var(--err) }
select { background: #0d0e13; color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; font: inherit }
.tblwrap { overflow-x: auto }
.tbl { width: 100%; border-collapse: collapse }
.tbl th, .tbl td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--line); white-space: nowrap }
.tbl th { color: var(--blue); font-weight: 600; border-top: 0; border-bottom: 1px solid var(--blue-d) }
.body { padding: 14px 16px }
.text { white-space: pre-wrap; word-break: break-word; margin-top: 6px }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line) }
.mrow:first-child { border-top: 0 } .mrow > .mute { margin-left: auto } .mrow .avatar { width: 30px; height: 30px; font-size: 12px }
a.mrow { color: var(--text) } a.mrow:hover { background: rgba(125, 155, 255, .05); text-decoration: none }
.grow { flex: 1; min-width: 0 }
img.avatar { object-fit: cover }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; box-shadow: none }
.avatar.big { width: 110px; height: 110px; font-size: 42px; border: 3px solid #12131a }
.i { width: 16px; height: 16px; vertical-align: -3px }
.me { display: flex; align-items: center; gap: 8px }
.badge { background: var(--blue-d); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10px; margin-left: 3px }
.badge:empty { display: none }
h1 .avatar { display: inline-grid; vertical-align: middle }

.crop { position: relative; overflow: hidden; aspect-ratio: 1500 / 290; margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 6px; background: #000; cursor: grab; touch-action: none }
.crop:active { cursor: grabbing } .crop:focus-visible { outline: 2px solid #7d9bff }
.crop img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; user-select: none }
.cover {display: block; width: 100%; aspect-ratio: 1500 / 290; object-fit: cover; position: relative; overflow: hidden;background: linear-gradient(135deg, #16224a, #0b0f20 60%, #1a1440) }
.cover .cpos { position: absolute; left: 0; top: 0; max-width: none }
.phead { display: flex; gap: 16px; align-items: flex-start; padding: 0 16px 16px; margin-top: -55px; position: relative }
.pinfo { padding-top: 62px; min-width: 0 } .pinfo:nth-child(2) { flex: 1 }
.pname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px } .pname h1 { margin: 0 }

.pm { height: 420px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px }
.pm-msg { max-width: 75%; align-self: flex-start; background: #1a1c24; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px }
.pm-msg .text { margin: 0 }
.pm-msg.mine { align-self: flex-end; background: #1c2a52; border-color: #2f4687 }

.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px }
.cols2 label { display: grid; gap: 4px }
.kvrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px } .kvrow button { margin-left: auto }
.tag.prio-low { opacity: .7 } .tag.prio-high { color: #ffa94d; border-color: #b8621b } .tag.prio-urgent { color: var(--err); border-color: #8a2f3b; font-weight: 700 }
.tag.available { color: var(--ok); border-color: #2c7a54 }
.tag.expired { color: var(--err); border-color: #8a2f3b }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line) }
.tabs a { padding: 8px 14px; color: var(--mute); border-bottom: 2px solid transparent }
.tabs a.on, .tabs a:hover { color: var(--blue); border-color: var(--blue); text-decoration: none }
.pact { display: flex; flex-wrap: wrap; gap: 6px }
.opt { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; font-size: 11px }
.staffmsg { border-left: 3px solid var(--blue-d) }
.reply { padding-top: 8px; margin-top: 8px }
code { color: var(--blue); letter-spacing: 1px }

/* formatted posts */
.text b { color: #fff } .text a { word-break: break-all }
.text code { background: #0b0c12; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; color: #b8c8ff }
.text pre { background: #0b0c12; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 6px 0; white-space: pre }
.text pre code { border: 0; padding: 0; background: none }
.text blockquote, blockquote.text { margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--blue-d); background: rgba(125, 155, 255, .05); color: #b9bdcc }
.pimg { display: block; max-width: 100%; max-height: 480px; border-radius: 6px; margin: 6px 0 }
.spoiler { background: #2a2d3a; color: transparent; border-radius: 3px; padding: 0 4px; cursor: pointer }
.spoiler:hover, .spoiler:focus { color: inherit }
.hint { margin: 6px 0 2px }
.pmeta { display: flex; justify-content: space-between; gap: 8px } .pmeta .x { font-size: 11px }
.x:hover { color: var(--blue) } .x[data-del]:hover { color: var(--err) }
a.mrow.unread { background: rgba(125, 155, 255, .07) } a.mrow.unread .grow { color: #fff }

/* account menu (click on your name) */
.umenu { position: relative }
.umenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px }
.umenu summary::-webkit-details-marker { display: none }
.menu { position: absolute; right: 0; top: calc(100% + 14px); width: 320px; max-width: calc(100vw - 32px); z-index: 10; font-size: 14px;
  background: #10111a; border: 1px solid var(--line); border-top: 2px solid var(--blue-d); border-radius: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .65) }
.mhead { display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line) }
.mhead > div:last-child { flex: 1; min-width: 0; display: grid; gap: 5px }
.mhead .kv.small { font-size: 12px }
.mname { font-size: 15px; font-weight: 600 }
.avatar.mid { width: 56px; height: 56px; font-size: 22px }
.avatar.big2 { width: 96px; height: 96px; font-size: 36px }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; padding: 4px 0; border-bottom: 1px solid var(--line) }
#user .menu a { color: var(--text) }
#user .mgrid a, #user .mlogout { display: block; padding: 7px 14px; font-size: 13px }
#user .mgrid a:hover, #user .mlogout:hover { background: rgba(125, 155, 255, .08); color: var(--blue); text-decoration: none }

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; padding-bottom: 10px }
  .links { gap: 12px }
  .cols, .cols2, .post, .form { grid-template-columns: minmax(0, 1fr) }
  .row { grid-template-columns: 28px minmax(0, 1fr) } .trow { grid-template-columns: minmax(0, 1fr) }
  .num, .last { display: none }
  .form .l { text-align: left; padding: 12px 12px 0 } .form .f { border-left: 0 } .actions { padding-left: 12px }
  .who { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line) }
  .foot { flex-direction: column }
  .phead { flex-wrap: wrap; margin-top: -40px } .pinfo:nth-child(3) { padding-top: 0 }
}

/* account pages: menu on the left */
body.side .acct { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start }
#side .box { padding: 6px 0; margin-bottom: 12px }
#side .side-h { padding: 10px 16px 6px; font-weight: 700; color: #fff; border-left: 3px solid #7d9bff; margin-top: 4px }
#side a { display: block; padding: 7px 16px; color: var(--mute); border-left: 3px solid transparent }
#side a:hover { color: var(--blue); text-decoration: none; background: rgba(125, 155, 255, .06) }
#side a.on { color: #fff; background: rgba(125, 155, 255, .12); border-left-color: #7d9bff }
@media (max-width: 720px) {
  body.side .acct { grid-template-columns: minmax(0, 1fr) }
  #side .box { display: flex; flex-wrap: wrap; padding: 6px; margin-bottom: 8px } #side .side-h { display: none }
  #side a { border: 0; padding: 6px 10px; border-radius: 6px }
}

/* confirmation window */
dialog.sure { padding: 0; max-width: min(420px, calc(100vw - 32px)); color: var(--text); border: 1px solid var(--line) }
dialog.sure::backdrop { background: rgba(0, 0, 0, .6) }

/* update 25: announcement, reactions, unread threads, members pages, 2FA QR code */
.annc { border-color: var(--blue-d); margin-top: 20px }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px }
.react { background: #1a1c24; border: 1px solid var(--line); border-radius: 12px; padding: 2px 9px; font: inherit; font-size: 12px; color: var(--text); cursor: pointer }
.react:hover { border-color: var(--blue-d) } .react.on { border-color: var(--blue); background: rgba(125, 155, 255, .15) }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 6px var(--blue) }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 20px }
.qr { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 6px }

/* staff panel: users */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px }
.stat { padding: 18px 20px; display: grid; gap: 2px }
.stat b { font-size: 26px; color: #fff; text-shadow: 0 0 14px rgba(125, 155, 255, .45) }
.stat span { color: var(--mute) }
.fold summary { padding: 14px 18px; cursor: pointer; display: flex; gap: 10px; align-items: baseline }
.fold summary::before { content: "▸"; color: var(--blue) } .fold[open] summary::before { content: "▾" }
.fold summary::-webkit-details-marker { display: none } .fold summary { list-style: none }
.ufind { display: flex; gap: 10px } .ufind input { flex: 1 } .ufind select { min-width: 140px }
#ucount { padding-top: 0 }
.uline { display: grid; grid-template-columns: minmax(0, 1fr) 160px 110px 110px; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line) }
.uhead { color: var(--blue); font-weight: 600; border-bottom: 1px solid var(--blue-d) }
.urow .uline:hover { background: rgba(125, 155, 255, .05) }
.uline .r { text-align: right }
.avatar.sq { width: 34px; height: 34px; border-radius: 8px; font-size: 13px; box-shadow: none; border: 1px solid #2f4687 }
.uman { display: grid; gap: 8px; padding: 12px 18px 16px 64px; background: var(--side); border-top: 1px dashed var(--line) }
.uman .kv { justify-content: flex-start; gap: 16px } .uman .kv > .mute { width: 70px; flex: none }
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr } .ufind { flex-wrap: wrap }
  .uline { grid-template-columns: minmax(0, 1fr) auto } .uline > :nth-child(2), .uline > :nth-child(3) { display: none }
  .uman { padding-left: 18px }
}
