:root{
  --bg:#000815;
  --panel:#010d18;
  --panel-2:#03121d;
  --accent:#a7d7bd;
  --accent-soft:#87b69b;
  --accent-dark:#496655;
  --text:#b7c2b8;
  --muted:#748179;
  --line:#3f5849;
  --line-soft:#24382f;
  --red:#d8665e;
  --gold:#bda76e;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{font:12px Tahoma,Verdana,Arial,sans-serif;background:var(--bg)}
a{color:var(--accent);text-decoration:none}a:hover{color:#e2f1e8;text-decoration:underline}
button,input,textarea,select{font:inherit}

/* Old forum canvas: no frame around the whole page. */
.site-grid{
  width:1180px;
  max-width:100%;
  margin:0 auto;
  display:grid;
  grid-template-columns:96px minmax(760px,960px) 96px;
  gap:14px;
  padding:6px 8px 10px;
  background:var(--bg);
  transform-origin:top center;
}
.gif-column{min-height:720px;background:transparent;overflow:visible}
.gif-column img{display:block;max-width:100%;height:auto;margin:0 auto 10px}
.forum-site{min-width:0}
.site-header{padding-top:0}
.logo-link{display:block;width:532px;max-width:72%;margin:0 auto 4px;line-height:0;user-select:none}
.site-logo{display:block;width:100%;height:auto;pointer-events:none;user-select:none}

.hotbar{display:flex;gap:5px;justify-content:center;margin:0 0 6px}
.hotbtn,.archive-hit{
  height:34px;
  border:1px solid var(--line);
  background:#020c16;
  box-shadow:inset 0 0 0 1px #071821;
  display:flex;align-items:center;justify-content:center;
}
.hotbtn{min-width:130px;padding:0 10px;color:var(--accent);font:700 14px Georgia,"Times New Roman",serif;gap:6px}
.hotbtn:hover{background:#061620;text-decoration:none}
.hotglyph{font:700 15px "Courier New",monospace;color:var(--accent)}
.archive-hit{width:58px;min-width:58px;background:#010812}
.archive-hit:hover{background:#000}

.session-strip{
  min-height:28px;border:1px solid var(--line);background:#01070c;padding:5px 9px;margin-bottom:6px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  font:10px "Courier New",monospace;color:#a9b4aa
}
.session-strip b{color:var(--accent)}
.flash-stack{margin:0 0 6px}.flash{border:1px solid var(--line);background:#061019;padding:6px 8px}.flash.error{color:#e79797}.flash.ok{color:var(--accent)}

.forum-block,.widget,.mini-chat,.form-panel,.profile-card,.admin-shell,.reply-box{border:1px solid var(--line);background:var(--panel)}
.forum-block{margin-bottom:6px}
.block-title{
  min-height:30px;padding:5px 9px;border-bottom:1px solid var(--line);font:16px Georgia,"Times New Roman",serif;
  display:flex;align-items:center;gap:7px;color:var(--accent);background:#08202a
}
.block-mark{font:700 15px "Courier New",monospace;color:var(--accent)}
.title-lime,.title-purple,.title-pink,.title-gold,.title-cyan{color:var(--accent);background:#08202a}

.board-head,.board-row{display:grid;grid-template-columns:minmax(350px,1fr) 70px 82px 245px}
.board-head{min-height:23px;align-items:center;background:#01070c;border-bottom:1px solid var(--line);color:var(--accent);font:11px Georgia,"Times New Roman",serif}
.board-head>div,.board-row>div{padding:4px 8px;border-right:1px solid var(--line-soft)}
.board-head>div:last-child,.board-row>div:last-child{border-right:0}.board-head>div:not(:first-child){text-align:center}
.board-row{min-height:63px;background:#000b14;border-bottom:1px solid var(--line-soft)}.board-row:last-child{border-bottom:0}.board-row>div{display:flex;align-items:center}
.board-main{gap:10px}.board-icon{
  width:56px;height:48px;flex:0 0 56px;border:1px solid var(--accent-dark);background:#04121a;display:grid;place-items:center;
  box-shadow:inset 0 0 0 1px #071c1c;color:var(--accent);text-decoration:none!important;overflow:hidden
}
.board-symbol{display:block;font:700 13px/1 "Courier New",monospace;white-space:nowrap;letter-spacing:-1px;color:var(--accent)}
.board-symbol.misc{font-size:20px;letter-spacing:1px}.board-symbol.photo{font-size:18px}.board-symbol.announce{font-size:21px;letter-spacing:1px}
.board-name{font-size:16px;color:var(--accent)}
.number-cell{justify-content:center;color:var(--accent);font:14px "Courier New",monospace}
.last-cell{display:block!important;line-height:1.25;padding-top:7px!important;color:#aeb9af;font-size:11px}.last-cell small{color:#75827a}.empty{color:#647168;font-style:italic}

.lower-grid{display:grid;grid-template-columns:39% 61%;gap:6px;margin-bottom:6px}.widget{min-height:96px}.widget-title{min-height:28px;padding:5px 8px;border-bottom:1px solid var(--line);font:15px Georgia,"Times New Roman",serif;color:var(--accent);background:#071b25}.widget-body{padding:7px 9px;line-height:1.42}.widget-body .leiv{color:var(--red);font-weight:bold}.recent-list>div{display:flex;gap:7px}.recent-list time{width:40px;flex:0 0 40px;color:var(--accent-soft);font-family:"Courier New",monospace}

.mini-chat{margin-bottom:0}.mini-chat .widget-title{background:#071b25;color:var(--accent)}
.chat-layout{display:grid;grid-template-columns:1fr 330px;gap:10px;padding:7px 9px}.chat-log{min-height:54px;max-height:70px;overflow:auto;font:10px/1.35 "Courier New",monospace}.chat-compose{display:flex;align-items:end;gap:5px}.chat-compose input{flex:1;height:27px;background:#00060b;color:#d5ddd6;border:1px solid var(--line);padding:3px 5px}.old-btn{display:inline-flex;align-items:center;justify-content:center;min-height:27px;padding:4px 10px;border:1px solid var(--accent-dark);background:#071018;color:var(--accent);cursor:pointer}.old-btn:hover{background:#0a1821;color:#fff;text-decoration:none}.link-btn{width:max-content}.accept{border-color:#557760}.reject{border-color:#734a4a;color:#df9d9d}
.chat-status{font:9px "Courier New",monospace;color:var(--muted);padding-top:2px}

.topic-actions{padding:6px 8px;border-bottom:1px solid var(--line);background:#01070c}.topic-head,.topic-row{display:grid;grid-template-columns:1fr 75px 220px}.topic-head{font-family:Georgia,"Times New Roman",serif;color:var(--accent);background:#01070c;border-bottom:1px solid var(--line)}.topic-head>div,.topic-row>div{padding:7px 8px;border-right:1px solid var(--line-soft)}.topic-head>div:last-child,.topic-row>div:last-child{border-right:0}.topic-row{border-bottom:1px solid var(--line-soft);background:#000b14}.topic-row:last-child{border-bottom:0}.topic-row>div:nth-child(2){text-align:center;color:var(--accent)}.empty-state{padding:18px;text-align:center;color:var(--muted);font-style:italic}
.thread-caption{border:1px solid var(--line);background:#01070c;padding:7px 9px;margin-bottom:6px}.admin-edit{float:right}
.forum-post{display:grid;grid-template-columns:145px 1fr;border:1px solid var(--line);background:#020b14;margin-bottom:6px}.post-author{padding:8px;border-right:1px solid var(--line);background:#040c13}.post-author>b,.post-author a b{color:var(--accent)}.post-author small{display:block;color:#7f8b82;margin-top:6px}.post-avatar,.big-avatar{display:grid;place-items:center;background:#07151e;border:1px solid var(--line);color:var(--accent);overflow:hidden}.post-avatar{width:86px;height:86px;margin:8px auto;font-size:30px}.post-avatar img,.big-avatar img,.member-avatar img{width:100%;height:100%;object-fit:cover}.post-content{min-width:0}.post-date{padding:6px 8px;border-bottom:1px solid var(--line-soft);color:#858f87;font:10px "Courier New",monospace}.post-text{padding:12px;min-height:100px;font-size:12px;line-height:1.48}.post-image{display:block;margin:0 12px 12px}.post-image img{max-width:min(100%,680px);max-height:520px;border:1px solid var(--line)}.signature{margin:14px 12px 8px;padding-top:6px;border-top:1px dashed var(--line-soft);color:#788a80;font-size:10px}.reply-box{margin-top:8px}

.form-panel{margin-top:6px}.form-panel.narrow{max-width:580px;margin-left:auto;margin-right:auto}.classic-form{padding:11px}.classic-form label{display:block;color:var(--accent);margin-bottom:9px}.classic-form input[type=text],.classic-form input[type=password],.classic-form textarea,.classic-form select{display:block;width:100%;margin-top:3px;background:#00070c;color:#d5ddd6;border:1px solid var(--line);padding:6px}.classic-form textarea{resize:vertical;min-height:85px}.file-label input[type=file]{display:block;margin-top:5px;color:#aeb9af}.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.checkbox-line{display:flex!important;align-items:center;gap:7px}.checkbox-line input{width:auto!important}
.members-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:8px}.member-card{border:1px solid var(--line);background:#020b14;padding:7px;display:flex;align-items:center;gap:7px;min-height:72px}.member-card:hover{text-decoration:none;background:#06131c}.member-avatar{width:46px;height:46px;flex:0 0 46px;border:1px solid var(--line);background:#07141d;display:grid;place-items:center;color:var(--accent);font-size:20px;overflow:hidden}.member-card b{display:block;color:var(--accent)}.member-card small{display:block;color:#78867d;margin-top:3px}
.profile-card{margin-top:6px}.profile-grid{display:grid;grid-template-columns:160px 1fr;gap:12px;padding:12px}.big-avatar{width:130px;height:130px;font-size:40px}.profile-grid dl{display:grid;grid-template-columns:120px 1fr;align-content:start}.profile-grid dt,.profile-grid dd{margin:0;padding:6px;border-bottom:1px solid var(--line-soft)}.profile-grid dt{color:var(--accent)}.profile-admin-entry{padding:0 12px 12px}
.message-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:8px}.message-tabs>div{border:1px solid var(--line)}.message-tabs h3{margin:0;padding:6px 8px;background:#07131c;color:var(--accent);font:15px Georgia,"Times New Roman",serif}.message-line{display:flex;justify-content:space-between;padding:7px 8px;border-top:1px solid var(--line-soft)}.message-line.unread{font-weight:bold;background:#07131d}.message-line time{color:#78847c}.message-view{padding:11px;line-height:1.48}.message-view>div{color:#858f88;border-bottom:1px solid var(--line);padding-bottom:7px}
.admin-shell{margin-top:6px}.admin-actions{display:flex;gap:6px;padding:8px;border-bottom:1px solid var(--line)}.admin-section{padding:8px;border-bottom:1px solid var(--line)}.admin-section:last-child{border-bottom:0}.admin-table{width:100%;border-collapse:collapse}.admin-table th,.admin-table td{text-align:left;border-bottom:1px solid var(--line-soft);padding:5px 7px}.admin-topic-list{display:grid}.admin-topic-list>a{display:flex;justify-content:space-between;gap:12px;padding:6px;border-bottom:1px solid var(--line-soft)}.admin-topic-list small{color:#7d8980}.post-edit-link{float:right}


/* --- v4 forum polish --- */
.board-symbol.user-chat-symbol{font-size:14px;letter-spacing:-1px}
.gif-column{min-height:600px}

.post-media{margin:0 12px 12px;max-width:100%}
.post-media img{display:block;max-width:min(100%,680px);max-height:520px;border:1px solid var(--line)}
.post-media video{display:block;width:min(100%,680px);max-height:520px;background:#000;border:1px solid var(--line)}
.post-media audio{display:block;width:min(100%,520px);height:34px}

.upload-field{margin:0 0 10px;color:var(--accent)}
.upload-caption{margin-bottom:4px}
.file-picker{display:flex;align-items:center;gap:8px;min-height:28px;position:relative;flex-wrap:wrap}
.file-control{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;overflow:hidden!important;pointer-events:none!important;margin:0!important;padding:0!important}
.file-button{display:inline-flex!important;align-items:center!important;width:max-content!important;min-height:27px!important;margin:0!important;padding:4px 9px!important;border:1px solid var(--accent-dark)!important;background:#071018!important;color:var(--accent)!important;cursor:pointer!important}
.file-button:hover{background:#0a1821!important;color:#fff!important}
.file-name{color:#9ca79f;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:360px}
.vertical-file-picker{display:grid;grid-template-columns:max-content 1fr;align-items:center}
.avatar-column{min-width:0}.avatar-upload{margin-top:7px}.avatar-upload .file-name{max-width:150px;white-space:normal;line-height:1.15}

.smiley-picker{display:flex;flex-wrap:wrap;gap:3px;margin:-4px 0 10px;padding:5px;border:1px solid var(--line-soft);background:#01070c;width:max-content;max-width:100%}
.smiley-picker .smiley-btn{min-width:28px;height:24px;padding:0 5px;border:1px solid #405546;background:#061018;color:#d4d9cf;font:11px "Courier New",monospace;cursor:pointer}
.smiley-picker .smiley-btn:hover{background:#0a1b24;color:#fff}
.smiley-picker::before{content:"ICQ";display:flex;align-items:center;padding:0 5px;color:#789085;font:9px "Courier New",monospace}

.recipient-field{position:relative}
.user-suggestions{position:absolute;z-index:20;left:0;right:0;top:100%;margin-top:-8px;border:1px solid var(--line);background:#020a12;box-shadow:0 5px 14px #000;max-height:190px;overflow:auto}
.user-suggestions button{display:block;width:100%;padding:6px 8px;border:0;border-bottom:1px solid var(--line-soft);background:#020a12;color:var(--accent);text-align:left;cursor:pointer}
.user-suggestions button:last-child{border-bottom:0}.user-suggestions button:hover,.user-suggestions button.active{background:#09202a;color:#fff}

.character-admin-row{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;padding:5px 0;border-bottom:1px solid var(--line-soft)}
.character-admin-row:last-child{border-bottom:0}.compact-btn{min-height:23px;padding:2px 7px;font-size:10px}.character-admin-row small{color:#7c8d83}
.current-avatar{width:90px;height:90px;border:1px solid var(--line);background:#07141d;margin:4px 0 8px;overflow:hidden}.current-avatar img{width:100%;height:100%;object-fit:cover}.field-hint{color:#78867d;font-weight:normal}

/* Same visual scale on every page. No page-specific zoom. */
@media(max-width:1180px){
  .site-grid{width:100%;grid-template-columns:80px minmax(700px,1fr) 80px;gap:10px;padding:5px 6px}
  .hotbtn{min-width:118px;padding:0 7px}.archive-hit{width:50px;min-width:50px}
}
@media(max-width:900px){
  .site-grid{display:block;width:100%;padding:5px 6px}.gif-column{display:none}.forum-site{width:100%}.logo-link{max-width:64%}
  .hotbar{flex-wrap:wrap}.hotbtn{min-width:118px}.archive-hit{width:50px}
  .board-head,.board-row{grid-template-columns:minmax(260px,1fr) 56px 68px 190px}
  .lower-grid{grid-template-columns:1fr}.chat-layout{grid-template-columns:1fr}.members-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:620px){
  body{font-size:11px}.site-grid{padding:3px}.logo-link{width:420px;max-width:92%}
  .hotbtn{min-width:46%;height:31px;font-size:12px}.archive-hit{min-width:46%;height:31px}
  .session-strip{font-size:9px;flex-wrap:wrap}.board-head{display:none}.board-row{grid-template-columns:1fr}.board-row>div{border-right:0!important;border-bottom:1px solid var(--line-soft)}
  .number-cell{justify-content:flex-start!important}.forum-post{grid-template-columns:105px 1fr}.post-avatar{width:70px;height:70px}.profile-grid{grid-template-columns:1fr}.members-grid{grid-template-columns:1fr}.two-fields{grid-template-columns:1fr}
}

/* --- v5 post identity / dates --- */
.post-username{display:block;color:var(--accent);font-size:13px;line-height:1.15}
.post-tag{
  margin:2px 0 5px;
  max-width:125px;
  color:#bda76e;
  font:9px/1.2 "Courier New",monospace;
  overflow-wrap:anywhere;
}
.post-date{
  color:#d3b768;
  font-weight:700;
  background:#01070c;
  letter-spacing:.1px;
}
.message-date{color:#d3b768;font-weight:700;font-family:"Courier New",monospace}

/* --- v5 old-forum BBCode toolbar --- */
.editor-toolbar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:3px;
  min-height:30px;
  margin:3px 0 0;
  padding:4px;
  border:1px solid var(--line);
  border-bottom:0;
  background:#020b13;
}
.editor-toolbar + textarea.message-editor{margin-top:0!important}
.editor-btn,
.editor-color-label{
  height:22px;
  min-width:25px;
  margin:0!important;
  padding:2px 6px;
  border:1px solid #455b4d;
  background:#07131b;
  color:#c6d7ca!important;
  font:10px Tahoma,Verdana,Arial,sans-serif!important;
  cursor:pointer;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  width:auto!important;
}
.editor-btn:hover,.editor-color-label:hover{background:#0a1c25;color:#fff!important}
.editor-b{font-weight:bold!important}.editor-i{font-style:italic!important}.editor-u{text-decoration:underline}.editor-s{text-decoration:line-through}
.editor-color-label{gap:4px;cursor:default}
.editor-color{width:22px;height:16px;border:0;padding:0;background:transparent;cursor:pointer}
.smiley-menu-wrap{position:relative;display:inline-flex}
.smiley-toggle{min-width:66px}
.smiley-popover{
  position:absolute;
  z-index:60;
  left:0;
  top:26px;
  width:252px;
  padding:6px;
  border:1px solid #64705e;
  background:#020a12;
  box-shadow:3px 4px 0 rgba(0,0,0,.65);
}
.smiley-popover[hidden]{display:none!important}
.smiley-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:3px}
.kolobok-btn{
  height:34px;
  min-width:0;
  padding:2px;
  border:1px solid #31483c;
  background:#06121a;
  cursor:pointer;
  display:grid;
  place-items:center;
}
.kolobok-btn:hover{background:#0c222a;border-color:#789a83}
.kolobok-btn img{display:block;max-width:29px;max-height:29px;width:auto;height:auto}
.smiley-credit{display:block;margin-top:5px;padding-top:4px;border-top:1px solid var(--line-soft);color:#71857a;font:8px "Courier New",monospace;text-align:right}

/* Rendered BBCode */
.formatted-text strong{font-weight:700;color:inherit}
.formatted-text em{font-style:italic}.formatted-text u{text-decoration:underline}.formatted-text s{text-decoration:line-through}
.bb-quote{margin:7px 0;padding:6px 9px;border-left:3px solid var(--accent-dark);background:#031019;color:#a8b8ad}
.bb-code{display:block;margin:7px 0;padding:6px 8px;border:1px solid var(--line-soft);background:#00060b;color:#b7d2bf;font:10px/1.45 "Courier New",monospace;white-space:pre-wrap}
.inline-smiley{display:inline-block;vertical-align:middle;max-width:36px;max-height:36px;width:auto;height:auto;margin:0 2px}
.message-body{padding:10px 0 2px;color:var(--text)!important;border-bottom:0!important}

/* Keep registration/profile tag fields compact in the old forum rhythm. */
.field-hint{color:#728078;font:9px "Courier New",monospace}
.member-tag{color:#bda76e!important;font:9px/1.2 "Courier New",monospace!important;margin:2px 0!important;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}


/* --- v6 homepage / mini-chat sidebar / larger old-forum text --- */
body{font-size:13px}
.session-strip{font-size:12px;line-height:1.25;min-height:32px;padding:6px 10px}
.hotbtn{font-size:15px;min-width:136px;height:38px}
.hotglyph{font:700 10px/1 "Courier New",monospace;white-space:nowrap;letter-spacing:-1px}
.board-head{font-size:12px;min-height:25px}
.last-cell{font-size:12px;line-height:1.3}.last-cell small{font-size:11px}
.number-cell{font-size:15px}.widget-body{font-size:12px}.recent-list time{font-size:11px}
.post-date{font-size:12px!important;padding:7px 9px!important}.message-date{font-size:12px}

/* More kaomoji-looking forum symbols. */
.board-symbol{font-size:12px;letter-spacing:-1.4px}
.board-symbol.misc{font-size:13px;letter-spacing:-1px}
.board-symbol.photo{font-size:12px;letter-spacing:-1px}
.board-symbol.announce{font-size:11px;letter-spacing:-1.5px}
.board-symbol.user-chat-symbol{font-size:12px;letter-spacing:-1px}

/* Index gets a real right-side chat column. Left side remains available for a narrow GIF. */
.home-page .site-grid{
  width:1370px;
  max-width:none;
  grid-template-columns:78px minmax(800px,1000px) 260px;
  gap:10px;
  padding:5px 6px 7px;
  align-items:start;
}
.home-page .gif-column-left{display:block;min-height:690px}
.home-page .gif-column-right{display:block;min-height:690px;padding-top:145px}
.side-mini-chat{width:100%;margin:0;min-height:500px;background:#000a13}
.side-mini-chat .widget-title{font-size:16px;min-height:30px;padding:6px 8px}
.side-chat-body{padding:7px}
.side-mini-chat .chat-log{min-height:360px;max-height:430px;overflow:auto;font:11px/1.42 "Courier New",monospace;padding:3px 2px 8px}
.chat-line{margin-bottom:4px;overflow-wrap:anywhere}
.side-chat-compose{border-top:1px solid var(--line-soft);padding-top:7px}
.side-chat-compose textarea{display:block;width:100%;height:58px;resize:none;background:#00060b;color:#d5ddd6;border:1px solid var(--line);padding:5px;font:11px/1.3 "Courier New",monospace}
.chat-tools{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:5px}
.chat-color-label{height:22px;padding:2px 5px;border:1px solid #455b4d;background:#07131b;color:#c6d7ca;font:10px Tahoma,Verdana,Arial,sans-serif;display:flex;align-items:center;gap:4px}
.chat-color-label input{width:22px;height:15px;border:0;padding:0;background:transparent}
.chat-submit-row{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:5px}
.chat-submit-row .chat-status{flex:1;min-width:0}
.chat-smiley-popover{left:auto;right:0;top:26px}
.side-gif-slot{margin-top:10px;min-height:90px}

/* The smiley palette itself stays clean: no source/credit line in the UI. */
.smiley-credit{display:none!important}

/* At small viewports the index keeps its desktop geometry and is fitted as one piece by JS. */
@media(max-width:900px){
  .home-page .site-grid{display:grid!important;width:1370px!important;max-width:none!important;grid-template-columns:78px 1000px 260px!important;gap:10px!important;padding:5px 6px 7px!important}
  .home-page .gif-column-left,.home-page .gif-column-right{display:block!important}
  .home-page .forum-site{width:auto!important}
  .home-page .logo-link{max-width:72%!important}
}

/* === FINAL LAYOUT / FRAME PASS === */
:root{
  --line:#66836f;
  --line-soft:#31483b;
  --accent:#a7d7bd;
  --accent-soft:#8fbfa5;
  --accent-dark:#557260;
}
html,body{background:#000815!important}
body{overflow-x:hidden}

/* One fixed late-2000s forum geometry on every page. JS scales this whole canvas
   to the viewport width instead of letting individual pages reflow differently. */
.site-grid,
.home-page .site-grid{
  width:1490px!important;
  max-width:none!important;
  margin:0 auto!important;
  display:grid!important;
  grid-template-columns:185px 1000px 270px!important;
  gap:17px!important;
  padding:6px 6px 10px!important;
  align-items:start!important;
  background:var(--bg)!important;
  transform-origin:top center!important;
}
.forum-site{width:1000px!important;min-width:1000px!important}
.site-header{width:100%;padding-top:0!important}
.logo-link{
  display:block!important;
  width:532px!important;
  max-width:none!important;
  margin:0 auto 7px!important;
  line-height:0!important;
  text-align:center!important;
}
.site-logo{display:block!important;width:532px!important;height:auto!important;margin:0 auto!important;pointer-events:none!important;user-select:none!important}

/* Two explicit left GIF slots, always part of the page chrome. */
.gif-column-left{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  gap:22px!important;
  padding-top:170px!important;
  min-height:760px!important;
}
.gif-frame{
  width:174px;
  height:270px;
  border:2px solid var(--line);
  background:#010a13;
  box-shadow:inset 0 0 0 2px #020f17;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.gif-banner{display:block;width:100%;height:100%;object-fit:cover;image-rendering:auto}

/* Mini-chat lives at the right on every regular page. */
.gif-column-right{
  display:block!important;
  padding-top:150px!important;
  min-height:760px!important;
  overflow:visible!important;
}
.side-mini-chat{
  width:270px!important;
  min-height:570px!important;
  margin:0!important;
  position:sticky;
  top:8px;
  background:#000a13!important;
  border:2px solid var(--line)!important;
  box-shadow:inset 0 0 0 1px #071821;
}
.side-mini-chat .widget-title{font-size:17px!important;min-height:31px!important;padding:6px 8px!important;border-bottom:2px solid var(--line)!important}
.side-chat-body{padding:8px!important}
.side-mini-chat .chat-log{min-height:385px!important;max-height:455px!important;overflow:auto!important;font:11px/1.45 "Courier New",monospace!important;padding:3px 2px 9px!important}
.side-chat-compose{border-top:2px solid var(--line-soft)!important;padding-top:8px!important}
.side-chat-compose textarea{width:100%!important;height:64px!important;resize:none!important;border:2px solid var(--line)!important}
.chat-tools{margin-bottom:6px!important}
.chat-submit-row{margin-top:6px!important}

/* Heavier forum chrome everywhere, while keeping internal table separators thin. */
.hotbtn,.archive-hit,.session-strip,.flash,
.forum-block,.widget,.mini-chat,.form-panel,.profile-card,.admin-shell,.reply-box,
.thread-caption,.forum-post,.member-card,.message-tabs>div,
.post-avatar,.big-avatar,.member-avatar,.board-icon,.file-button,.old-btn,
.classic-form input[type=text],.classic-form input[type=password],.classic-form textarea,.classic-form select,
.upload-field,.editor-toolbar,.smiley-popover{
  border-width:2px!important;
}
.forum-block,.widget,.form-panel,.profile-card,.admin-shell,.reply-box,.thread-caption,.forum-post{box-shadow:inset 0 0 0 1px #08151b}
.block-title,.widget-title{border-bottom-width:2px!important}
.board-head{border-bottom-width:2px!important}
.board-row{border-bottom:1px solid var(--line)!important}
.topic-head{border-bottom-width:2px!important}
.topic-row{border-bottom:1px solid var(--line)!important}
.post-date{border-bottom-width:2px!important}
.hotbtn,.archive-hit{box-shadow:inset 0 0 0 1px #071821}

/* Topic identity: nickname and user tag sit centered directly above the avatar. */
.post-author{text-align:center!important;padding:10px 8px!important}
.post-username{display:block!important;text-align:center!important;font-size:14px!important;line-height:1.2!important;margin:0 auto 3px!important}
.post-tag{display:block!important;max-width:132px!important;margin:0 auto 7px!important;text-align:center!important;font-size:10px!important;line-height:1.25!important}
.post-avatar{margin:7px auto 8px!important}
.post-author small{text-align:center!important;font-size:10px!important;line-height:1.4!important}
.post-date{font-size:13px!important;font-weight:700!important;color:#d7bc73!important;padding:7px 9px!important}

/* Keep all text/readability at the same visual scale as the members page. */
body{font-size:13px!important}
.session-strip{font-size:12px!important;min-height:32px!important}
.hotbtn{font-size:15px!important;height:38px!important}
.board-name{font-size:16px!important}
.widget-body,.last-cell{font-size:12px!important}

/* Disable the old responsive reflow. The whole canvas is scaled uniformly by JS. */
@media(max-width:1500px){
  .site-grid,.home-page .site-grid{width:1490px!important;max-width:none!important;display:grid!important;grid-template-columns:185px 1000px 270px!important;gap:17px!important;padding:6px 6px 10px!important}
  .gif-column,.home-page .gif-column-left,.home-page .gif-column-right{display:block!important}
  .gif-column-left{display:flex!important}
  .forum-site{width:1000px!important;min-width:1000px!important}
  .logo-link,.home-page .logo-link{width:532px!important;max-width:none!important}
  .board-head,.board-row{grid-template-columns:minmax(350px,1fr) 70px 82px 245px!important}
  .members-grid{grid-template-columns:repeat(4,1fr)!important}
  .lower-grid{grid-template-columns:39% 61%!important}
  .profile-grid{grid-template-columns:160px 1fr!important}
  .two-fields{grid-template-columns:1fr 1fr!important}
  .forum-post{grid-template-columns:145px 1fr!important}
}
@media(max-width:1500px){
  .gif-column-left,.home-page .gif-column-left{display:flex!important;flex-direction:column!important;align-items:center!important;gap:22px!important}
}


/* === FINAL GEOMETRY PATCH v2 ===
   Right chat is aligned by JS to the hotbar and the bottom of the homepage widgets.
   Left GIF slots are compact 4:3 frames. */
.gif-column-left,
.home-page .gif-column-left{
  padding-top:170px!important;
  gap:26px!important;
  min-height:0!important;
}
.gif-frame{
  width:180px!important;
  height:135px!important;
  aspect-ratio:4 / 3;
  border:2px solid var(--line)!important;
  background:#010a13!important;
  box-shadow:inset 0 0 0 1px #06151c!important;
}
.gif-banner{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}

/* The rail itself has no guessed top offset anymore; JS computes exact alignment. */
.gif-column-right,
.home-page .gif-column-right{
  padding-top:0!important;
  min-height:0!important;
  overflow:visible!important;
}
.side-mini-chat{
  position:relative!important;
  top:auto!important;
  min-height:0!important;
  height:570px;
}
.side-chat-body{
  height:calc(100% - 31px)!important;
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
}
.side-mini-chat .chat-log{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:auto!important;
}
.side-chat-compose{flex:0 0 auto!important}

/* Home page is a fixed one-screen old-forum canvas. */
body.home-page{
  overflow:hidden!important;
  height:100vh!important;
  min-height:100vh!important;
}
.home-page .site-grid{margin-top:0!important;margin-bottom:0!important}


/* === FINAL GEOMETRY PATCH v3 ===
   3 compact 4:3 GIF slots, recent widgets locked to center width,
   right mini-chat aligned by unscaled DOM offsets. */
.gif-column-left,
.home-page .gif-column-left{
  padding-top:170px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  gap:24px!important;
  min-height:0!important;
}
.gif-frame{
  width:180px!important;
  height:135px!important;
  min-width:180px!important;
  min-height:135px!important;
  aspect-ratio:4/3!important;
  flex:0 0 135px!important;
  border:2px solid var(--line)!important;
  background:#010a13!important;
  box-shadow:inset 0 0 0 1px #06151c!important;
  overflow:hidden!important;
}
.gif-banner{width:100%!important;height:100%!important;object-fit:cover!important;display:block}

/* The center widgets always stay exactly inside the 1000px forum column. */
.lower-grid{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:minmax(0,39%) minmax(0,61%)!important;
  gap:6px!important;
  margin-left:0!important;
  margin-right:0!important;
}
.lower-grid > .widget{min-width:0!important;width:100%!important;max-width:100%!important}
.widget-recent{overflow:hidden!important}
.recent-list{min-width:0!important;overflow:hidden!important}
.recent-list>div{min-width:0!important}
.recent-list a{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}

/* Right rail contains only the chat. JS sets its unscaled padding/height. */
.gif-column-right,
.home-page .gif-column-right{
  padding-top:0!important;
  min-height:0!important;
  overflow:visible!important;
  display:block!important;
}
.side-mini-chat{
  position:relative!important;
  top:auto!important;
  width:100%!important;
  min-height:0!important;
  margin:0!important;
}
.side-chat-body{
  height:calc(100% - 31px)!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
}
.side-mini-chat .chat-log{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:auto!important;
}
.side-chat-compose{flex:0 0 auto!important}


/* === FINAL UNIFORM SCALE PATCH v4 ===
   Geometry is identical on every route. Scaling is handled only by the
   width-based JS rule in site.js. */
.site-grid,
.home-page .site-grid{
  width:1490px!important;
  max-width:none!important;
  grid-template-columns:185px 1000px 270px!important;
  gap:17px!important;
  transform:none!important;
  transform-origin:top center!important;
}
.forum-site,
.home-page .forum-site{width:1000px!important;min-width:1000px!important;max-width:1000px!important}
.logo-link,
.home-page .logo-link{width:532px!important;max-width:532px!important;margin-left:auto!important;margin-right:auto!important}
.site-logo,
.home-page .site-logo{width:532px!important;max-width:532px!important;height:auto!important}
/* Do not use CSS zoom/transform on individual pages. */
body.home-page{height:auto!important;min-height:100vh!important}


/* === FINAL LAYOUT PATCH v5 ===
   The obsolete homepage footer widgets are gone. The right chat is aligned
   to .page-content-area, and all three GIF slots keep their full borders. */
.page-content-area{width:100%;min-width:0;margin:0;padding:0}
.home-page .page-content-area{width:1000px;max-width:1000px}

/* Removed blocks must never reserve layout space. */
.home-page .lower-grid{display:none!important}

/* Three compact 4:3 GIF frames with unbroken borders. */
.gif-column-left,
.home-page .gif-column-left{
  padding-top:170px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  gap:24px!important;
}
.gif-frame{
  box-sizing:border-box!important;
  width:180px!important;
  height:135px!important;
  min-width:180px!important;
  min-height:135px!important;
  flex:0 0 135px!important;
  border:2px solid var(--accent-dark)!important;
  background:#010a13!important;
  box-shadow:inset 0 0 0 1px #06151c!important;
  overflow:hidden!important;
}
.gif-frame:last-child{margin-bottom:0!important}

/* Right chat has no static offset. JS anchors it to page-content-area. */
.gif-column-right,
.home-page .gif-column-right{
  padding-top:0!important;
  min-height:0!important;
  display:block!important;
}
.side-mini-chat{
  width:100%!important;
  min-height:260px!important;
  margin:0!important;
  border:2px solid var(--accent-dark)!important;
  box-sizing:border-box!important;
}
.side-mini-chat .widget-title{border-bottom:2px solid var(--accent-dark)!important}

/* With the lower widgets removed, the homepage is a single compact slab. */
.home-page .forum-block:last-child{margin-bottom:0!important}


/* === CHAT POSITION FINAL PATCH v6 ===
   The whole site uses the same 1490px natural canvas. The chat is therefore
   positioned with fixed natural-canvas geometry and scales together with the
   rest of the site. No JS alignment is used. */
.gif-column-right,
.home-page .gif-column-right{
  padding-top:188px!important;
  min-height:0!important;
  display:block!important;
  align-self:start!important;
  box-sizing:border-box!important;
}
.side-mini-chat,
.home-page .side-mini-chat{
  position:relative!important;
  top:0!important;
  width:270px!important;
  height:565px!important;
  min-height:565px!important;
  max-height:565px!important;
  margin:0!important;
  box-sizing:border-box!important;
  border:2px solid var(--accent-dark)!important;
}
.side-chat-body{
  height:calc(100% - 31px)!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
}
.side-mini-chat .chat-log{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:auto!important;
}

/* === CHAT EXACT RED-BOX PATCH v7 ===
   Calibrated against the user's 1904x896 reference screenshot.
   On the fixed 1490px forum canvas the requested red rectangle maps to:
   top ~= 165px, width ~= 255px, height ~= 473px.
   Keep this purely CSS-driven so it cannot drift between routes. */
.gif-column-right,
.home-page .gif-column-right{
  padding-top:165px!important;
  min-height:0!important;
  display:block!important;
  align-self:start!important;
  box-sizing:border-box!important;
}
.side-mini-chat,
.home-page .side-mini-chat{
  position:relative!important;
  top:0!important;
  left:-5px!important;
  width:255px!important;
  min-width:255px!important;
  max-width:255px!important;
  height:473px!important;
  min-height:473px!important;
  max-height:473px!important;
  margin:0!important;
  box-sizing:border-box!important;
  border:2px solid var(--accent-dark)!important;
}
.side-mini-chat .widget-title{
  box-sizing:border-box!important;
  width:100%!important;
}
.side-chat-body{
  height:calc(100% - 31px)!important;
  min-height:0!important;
  overflow:hidden!important;
}
.side-mini-chat .chat-log{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:auto!important;
}

/* Невидимая кнопка архива */
.archive-hotspot {
    display: inline-block;
    width: 68px;
    height: 46px;

    margin: 0;
    padding: 0;

    border: none !important;
    outline: none !important;
    box-shadow: none !important;

    background: transparent !important;
    color: transparent !important;

    text-decoration: none !important;
    cursor: pointer;
}

.archive-hotspot:hover,
.archive-hotspot:focus,
.archive-hotspot:active,
.archive-hotspot:visited {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}


/* ==========================================================
   POLYBIUS — invisible archive hotspot
   ========================================================== */

.archive-hit,
.archive-hit:hover,
.archive-hit:focus,
.archive-hit:active,
.archive-hit:visited {
    display: block !important;

    width: 68px !important;
    min-width: 68px !important;
    height: 46px !important;
    flex: 0 0 68px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;

    background: transparent !important;
    color: transparent !important;

    text-decoration: none !important;
}

/* Невидимая область остаётся кликабельной */
.archive-hit {
    cursor: pointer !important;
}


/* ==========================================================
   POLYBIUS MOBILE
   Desktop layout above remains untouched.
   ========================================================== */

@media (max-width: 700px) {

    html {
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body,
    body.home-page {
        width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: 100vh !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;
    }


    /* ------------------------------------------------------
       Отключаем фиксированный desktop canvas 1490px
       ------------------------------------------------------ */

    .site-grid,
    .home-page .site-grid {
        box-sizing: border-box !important;

        display: flex !important;
        flex-direction: column !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        height: auto !important;
        min-height: 0 !important;

        grid-template-columns: none !important;

        gap: 8px !important;

        margin: 0 !important;
        padding: 5px !important;

        transform: none !important;
        transform-origin: initial !important;

        zoom: 1 !important;
    }


    /* ------------------------------------------------------
       Центральная часть форума
       ------------------------------------------------------ */

    .forum-site,
    .home-page .forum-site {
        box-sizing: border-box !important;

        order: 1 !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        margin: 0 !important;
    }

    .site-header,
    .page-content-area,
    .home-page .page-content-area {
        box-sizing: border-box !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }


    /* ------------------------------------------------------
       Логотип
       ------------------------------------------------------ */

    .logo-link,
    .home-page .logo-link {
        width: min(532px, 94vw) !important;
        max-width: 94vw !important;

        margin: 5px auto 7px !important;
    }

    .site-logo,
    .home-page .site-logo {
        display: block !important;

        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;

        margin: 0 auto !important;
    }


    /* ------------------------------------------------------
       Верхнее меню
       ------------------------------------------------------ */

    .hotbar {
        position: relative !important;

        display: flex !important;
        flex-wrap: wrap !important;

        width: 100% !important;

        justify-content: center !important;
        align-items: stretch !important;

        gap: 5px !important;

        margin-bottom: 6px !important;
    }

    .hotbtn {
        box-sizing: border-box !important;

        flex: 1 1 40% !important;

        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;

        height: auto !important;
        min-height: 38px !important;

        padding: 5px 6px !important;

        font-size: 12px !important;
        line-height: 1.15 !important;

        white-space: normal !important;

        text-align: center !important;
    }

    .hotglyph {
        flex: 0 0 auto !important;
    }

    .archive-hit,
    .archive-hit:hover,
    .archive-hit:focus,
    .archive-hit:active {
        flex: 0 0 44px !important;

        width: 44px !important;
        min-width: 44px !important;

        height: 38px !important;
        min-height: 38px !important;

        border: 0 !important;
        outline: 0 !important;
        box-shadow: none !important;

        background: transparent !important;
    }


    /* ------------------------------------------------------
       Строка входа
       ------------------------------------------------------ */

    .session-strip {
        box-sizing: border-box !important;

        width: 100% !important;

        min-height: 0 !important;

        display: flex !important;
        flex-wrap: wrap !important;

        gap: 3px 10px !important;

        padding: 6px 8px !important;

        font-size: 10px !important;
        line-height: 1.3 !important;
    }


    /* ------------------------------------------------------
       Разделы форума
       ------------------------------------------------------ */

    .forum-block {
        box-sizing: border-box !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .board-head {
        display: none !important;
    }

    .board-row {
        display: grid !important;

        width: 100% !important;
        min-width: 0 !important;

        grid-template-columns: 1fr 1fr !important;

        min-height: 0 !important;
    }

    .board-row > div {
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    /* название раздела */
    .board-row > div:nth-child(1) {
        grid-column: 1 / -1 !important;

        min-height: 64px !important;

        border-right: 0 !important;
        border-bottom: 1px solid var(--line-soft) !important;
    }

    /* темы / сообщения */
    .board-row > div:nth-child(2),
    .board-row > div:nth-child(3) {
        min-height: 32px !important;

        justify-content: center !important;

        border-bottom: 1px solid var(--line-soft) !important;
    }

    .board-row > div:nth-child(2)::before {
        content: "Темы: ";
        margin-right: 5px;

        color: var(--muted);
        font-size: 9px;
    }

    .board-row > div:nth-child(3)::before {
        content: "Сообщения: ";
        margin-right: 5px;

        color: var(--muted);
        font-size: 9px;
    }

    /* последнее сообщение */
    .board-row > div:nth-child(4) {
        grid-column: 1 / -1 !important;

        min-height: 34px !important;

        padding: 6px 8px !important;

        border-right: 0 !important;
    }

    .board-main {
        gap: 9px !important;
    }

    .board-icon {
        width: 56px !important;
        height: 48px !important;

        flex: 0 0 56px !important;
    }


    /* ------------------------------------------------------
       Темы внутри разделов
       ------------------------------------------------------ */

    .topic-head {
        display: none !important;
    }

    .topic-row {
        display: grid !important;

        grid-template-columns: 1fr !important;

        width: 100% !important;
        min-width: 0 !important;
    }

    .topic-row > div {
        box-sizing: border-box !important;

        min-width: 0 !important;

        border-right: 0 !important;
        border-bottom: 1px solid var(--line-soft) !important;
    }


    /* ------------------------------------------------------
       Посты
       ------------------------------------------------------ */

    .forum-post {
        display: grid !important;

        width: 100% !important;
        min-width: 0 !important;

        grid-template-columns: 92px minmax(0, 1fr) !important;
    }

    .post-author {
        box-sizing: border-box !important;

        min-width: 0 !important;

        padding: 6px !important;
    }

    .post-avatar {
        width: 68px !important;
        height: 68px !important;

        margin: 7px auto !important;
    }

    .post-username {
        font-size: 11px !important;

        overflow-wrap: anywhere !important;
    }

    .post-tag {
        max-width: 78px !important;

        font-size: 8px !important;

        white-space: normal !important;
    }

    .post-content {
        min-width: 0 !important;
    }

    .post-text {
        box-sizing: border-box !important;

        min-width: 0 !important;

        padding: 9px !important;

        font-size: 11px !important;

        overflow-wrap: anywhere !important;
    }

    .post-media,
    .post-image {
        box-sizing: border-box !important;

        max-width: calc(100% - 16px) !important;

        margin: 0 8px 8px !important;
    }

    .post-media img,
    .post-media video,
    .post-image img {
        max-width: 100% !important;
        height: auto !important;
    }


    /* ------------------------------------------------------
       Профили / участники
       ------------------------------------------------------ */

    .members-grid {
        display: grid !important;

        grid-template-columns: 1fr !important;

        width: 100% !important;

        padding: 6px !important;
    }

    .profile-grid {
        display: grid !important;

        grid-template-columns: 1fr !important;

        width: 100% !important;
        min-width: 0 !important;

        padding: 8px !important;
    }

    .big-avatar {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .profile-grid dl {
        grid-template-columns: 105px minmax(0, 1fr) !important;

        width: 100% !important;
    }


    /* ------------------------------------------------------
       Личные сообщения
       ------------------------------------------------------ */

    .message-tabs {
        display: grid !important;

        grid-template-columns: 1fr !important;

        width: 100% !important;

        padding: 6px !important;
    }

    .message-line {
        gap: 8px !important;
    }


    /* ------------------------------------------------------
       Формы
       ------------------------------------------------------ */

    .form-panel,
    .form-panel.narrow {
        box-sizing: border-box !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .classic-form {
        box-sizing: border-box !important;

        width: 100% !important;

        padding: 8px !important;
    }

    .classic-form input[type=text],
    .classic-form input[type=password],
    .classic-form textarea,
    .classic-form select {
        box-sizing: border-box !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    .two-fields {
        grid-template-columns: 1fr !important;
    }

    .file-name {
        max-width: 190px !important;
    }


    /* ------------------------------------------------------
       BBCode / smileys
       ------------------------------------------------------ */

    .editor-toolbar {
        flex-wrap: wrap !important;
    }

    .smiley-popover,
    .chat-smiley-popover {
        max-width: calc(100vw - 30px) !important;
    }

    .smiley-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }


    /* ------------------------------------------------------
       Админка
       ------------------------------------------------------ */

    .admin-shell {
        box-sizing: border-box !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
    }

    .admin-actions {
        flex-wrap: wrap !important;
    }

    .admin-section {
        overflow-x: auto !important;
    }

    .admin-table {
        min-width: 620px;
    }


    /* ------------------------------------------------------
       Правый блок: мини-чат
       На телефоне он идёт ПОД форумом
       ------------------------------------------------------ */

    .gif-column-right,
    .home-page .gif-column-right {
        box-sizing: border-box !important;

        order: 2 !important;

        display: block !important;

        position: static !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: visible !important;
    }

    .side-mini-chat,
    .home-page .side-mini-chat {
        box-sizing: border-box !important;

        position: static !important;

        top: auto !important;
        left: auto !important;
        right: auto !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        height: auto !important;
        min-height: 340px !important;
        max-height: none !important;

        margin: 0 !important;
    }

    .side-chat-body {
        box-sizing: border-box !important;

        display: flex !important;
        flex-direction: column !important;

        width: 100% !important;

        height: auto !important;
        min-height: 300px !important;
    }

    .side-mini-chat .chat-log {
        flex: 1 1 auto !important;

        min-height: 230px !important;
        max-height: 310px !important;

        overflow-y: auto !important;
    }

    .side-chat-compose textarea {
        height: 64px !important;
    }


    /* ------------------------------------------------------
       Левые GIF-баннеры
       На телефоне идут после чата
       ------------------------------------------------------ */

    .gif-column-left,
    .home-page .gif-column-left {
        box-sizing: border-box !important;

        order: 3 !important;

        display: flex !important;
        flex-direction: column !important;

        position: static !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        height: auto !important;
        min-height: 0 !important;

        align-items: center !important;

        gap: 10px !important;

        margin: 0 !important;
        padding: 4px 0 12px !important;

        overflow: visible !important;
    }

    .gif-frame,
    .home-page .gif-frame {
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;

        height: 135px !important;
        min-height: 135px !important;
        max-height: 135px !important;

        margin: 0 !important;
    }

    .gif-banner {
        width: 100% !important;
        height: 100% !important;

        object-fit: cover !important;
    }


    /* ------------------------------------------------------
       Никакого desktop one-screen режима на телефоне
       ------------------------------------------------------ */

    body.home-page,
    .home-page .site-grid,
    .home-page .forum-site,
    .home-page .page-content-area {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }

}


/* ==========================================================
   POLYBIUS MOBILE — cleanup / spacing
   ========================================================== */

@media (max-width: 700px) {

    /* На мобильной версии полностью убираем GIF-баннеры */
    .gif-column-left,
    .home-page .gif-column-left {
        display: none !important;
    }


    /* Чуть больше воздуха между основными блоками форума */
    .forum-block {
        margin-bottom: 12px !important;
    }


    /* Отделяем шапку от содержимого */
    .session-strip {
        margin-bottom: 10px !important;
    }


    /* Мини-чат не прилипает к форуму */
    .gif-column-right,
    .home-page .gif-column-right {
        margin-top: 8px !important;
    }

    .side-mini-chat,
    .home-page .side-mini-chat {
        margin-top: 0 !important;
        margin-bottom: 12px !important;
    }


    /* Темы / посты тоже немного раздвигаем */
    .forum-post {
        margin-bottom: 10px !important;
    }

    .form-panel,
    .profile-card,
    .admin-shell,
    .reply-box {
        margin-bottom: 10px !important;
    }

}

/* PC — slightly lower side blocks */
@media (min-width: 701px) {
    .gif-column-left,
    .gif-column-right {
        transform: translateY(20px) !important;
    }
}

/* PC — fine tuning side blocks */
@media (min-width: 701px) {
    .gif-column-left {
        transform: translateY(17px) !important;
    }

    .gif-column-right {
        transform: translateY(15px) !important;
    }
}

/* PC — final side blocks position */
@media (min-width: 701px) {
    .gif-column-left {
        transform: translateY(14px) !important;
    }

    .gif-column-right {
        transform: translateY(8px) !important;
    }
}

/* Убираем рамки вокруг GIF-баннеров */
.gif-frame,
.home-page .gif-frame {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

/* ==========================================================
   POLYBIUS — larger smiley chooser
   ========================================================== */

.chat-smiley-popover {
    width: 360px !important;
    max-width: min(360px, 90vw) !important;
    max-height: 320px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 7px !important;
    z-index: 9999 !important;
}

.chat-smiley-popover .smiley-grid {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(34px, 1fr)) !important;
    gap: 5px !important;
}

.chat-smiley-popover .kolobok-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    padding: 2px !important;
}

.chat-smiley-popover .kolobok-btn img {
    max-width: 32px !important;
    max-height: 32px !important;
}

/* Admin/persona boards: no date/time bar, only invisible-layout edit action */
.post-admin-edit-only {
    min-height: 18px;
    padding: 3px 8px;
    border: 0 !important;
    background: transparent !important;
}

.post-admin-edit-only .post-edit-link {
    float: right;
}

.post-admin-edit-only {
    min-height: 18px;
    padding: 3px 8px;
    border: 0 !important;
    background: transparent !important;
}

.post-admin-edit-only .post-edit-link {
    float: right;
}

/* ==========================================================
   POLYBIUS — FINAL mini-chat smiley popup
   ========================================================== */

/* Обёртка может выпускать popup наружу */
.chat-tools,
.chat-smiley-wrap,
.side-chat-compose,
.side-chat-body,
.side-mini-chat {
    overflow: visible !important;
}

/* Сам popup — компактный и открывается влево */
.chat-smiley-popover {
    position: absolute !important;

    width: 230px !important;
    max-width: 230px !important;

    left: 0 !important;
    right: auto !important;
    top: 28px !important;

    padding: 6px !important;

    overflow: visible !important;

    z-index: 99999 !important;

    box-sizing: border-box !important;
}

/* ровно 5 колонок */
.chat-smiley-popover .smiley-grid {
    display: grid !important;

    grid-template-columns: repeat(5, 38px) !important;
    grid-auto-rows: 38px !important;

    gap: 5px !important;

    width: auto !important;
}

/* одинаковые ячейки */
.chat-smiley-popover .kolobok-btn {
    width: 38px !important;
    min-width: 38px !important;

    height: 38px !important;
    min-height: 38px !important;

    padding: 2px !important;

    box-sizing: border-box !important;
}

/* сами колобки */
.chat-smiley-popover .kolobok-btn img {
    display: block !important;

    max-width: 30px !important;
    max-height: 30px !important;

    width: auto !important;
    height: auto !important;

    margin: auto !important;
}

/* main-посты: ссылка редактирования без отдельной полосы */
.post-edit-main {
    display: block !important;
    float: right !important;

    margin: 5px 8px 0 8px !important;

    font-size: 10px !important;
}

/* старый временный контейнер больше не нужен */
.post-admin-edit-only {
    display: none !important;
}



/* ==========================================================
   POLYBIUS — discussion list readability
   ========================================================== */

.board-page .topic-head,
.board-page .topic-row {
    grid-template-columns: minmax(0, 1fr) 90px 205px !important;
}


/* Строка обсуждения стала выше */
.board-page .topic-row {
    min-height: 76px !important;
}


/* Главная ячейка с названием + превью */
.topic-title-cell {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;

    min-width: 0 !important;

    padding: 10px 12px !important;
}


/* Само название обсуждения */
.topic-title-link {
    display: block !important;

    width: max-content;
    max-width: 100%;

    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    font-weight: normal !important;

    color: var(--accent) !important;

    overflow-wrap: anywhere;
}


/* Кусочек последнего сообщения */
.topic-preview {
    margin-top: 6px !important;

    max-width: 760px !important;

    color: #94a49a !important;

    font-family: "Courier New", monospace !important;
    font-size: 11px !important;
    line-height: 1.35 !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}


/* Ответы */
.topic-replies {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-size: 14px !important;
}


/* Автор последнего сообщения */
.topic-last-user {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;

    padding: 8px 10px !important;

    color: var(--accent) !important;
}


/* Дата остаётся только в пользовательском разделе */
.topic-last-user small {
    display: block !important;

    margin-top: 4px !important;

    color: #77857c !important;
    font-size: 9px !important;
}


/* Телефон */
@media (max-width: 700px) {

    .board-page .topic-row {
        grid-template-columns: 1fr !important;
        min-height: 0 !important;

        margin-bottom: 8px !important;
    }

    .topic-title-link {
        font-size: 16px !important;
    }

    .topic-preview {
        white-space: normal !important;

        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;

        overflow: hidden !important;
    }

    .topic-replies,
    .topic-last-user {
        min-height: 30px !important;
        justify-content: flex-start !important;

        padding: 5px 10px !important;
    }
}



/* ==========================================================
   POLYBIUS — private message dialogs
   ========================================================== */

.profile-message-action {
    padding: 0 12px 12px;
}


/* две колонки: люди / переписка */
.pm-layout {
    display: grid;

    grid-template-columns: 260px minmax(0, 1fr);

    min-height: 430px;

    border-top: 1px solid var(--line);
}


/* -----------------------
   СПИСОК ДИАЛОГОВ
   ----------------------- */

.pm-dialog-list {
    min-width: 0;

    border-right: 1px solid var(--line);

    background: #020a12;
}

.pm-dialog-title {
    padding: 7px 9px;

    border-bottom: 1px solid var(--line);

    background: #071b25;

    color: var(--accent);

    font: 15px Georgia, "Times New Roman", serif;
}

.pm-dialog {
    display: flex;

    gap: 8px;
    align-items: center;

    min-height: 58px;

    padding: 7px;

    border-bottom: 1px solid var(--line-soft);

    color: var(--text) !important;

    text-decoration: none !important;
}

.pm-dialog:hover,
.pm-dialog.active {
    background: #07151d;
}

.pm-dialog.active {
    box-shadow: inset 3px 0 0 var(--accent);
}


/* аватар */
.pm-dialog-avatar {
    display: grid;

    place-items: center;

    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    overflow: hidden;

    border: 1px solid var(--line);

    background: #07151e;

    color: var(--accent);

    font-size: 17px;
}

.pm-dialog-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


.pm-dialog-info {
    min-width: 0;

    flex: 1;
}

.pm-dialog-user {
    color: var(--accent);

    font-weight: bold;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-dialog-preview {
    margin-top: 4px;

    color: #7f9187;

    font: 9px/1.25 "Courier New", monospace;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-unread {
    display: inline-block;

    min-width: 16px;

    margin-left: 4px;
    padding: 1px 4px;

    border: 1px solid var(--accent-dark);

    text-align: center;

    color: var(--accent);
}


/* -----------------------
   ПЕРЕПИСКА
   ----------------------- */

.pm-conversation {
    display: flex;

    flex-direction: column;

    min-width: 0;

    background: #000912;
}

.pm-conversation-head {
    display: flex;

    justify-content: space-between;
    align-items: center;

    min-height: 36px;

    padding: 6px 9px;

    border-bottom: 1px solid var(--line);

    background: #07131c;

    font: 15px Georgia, "Times New Roman", serif;
}

.pm-thread {
    padding: 8px;

    overflow-y: auto;
}


/* сообщения */
.pm-message {
    margin-bottom: 8px;

    border: 1px solid var(--line-soft);

    background: #020b14;
}

.pm-message.mine {
    margin-left: 55px;
}

.pm-message.theirs {
    margin-right: 55px;
}

.pm-message-meta {
    display: flex;

    justify-content: space-between;

    gap: 12px;

    padding: 5px 7px;

    border-bottom: 1px solid var(--line-soft);

    color: #7f8d84;

    font: 9px "Courier New", monospace;
}

.pm-message-meta b {
    color: var(--accent);
}

.pm-message-body {
    padding: 9px 10px;

    line-height: 1.45;
}

.pm-no-dialog {
    padding: 35px;

    text-align: center;

    color: var(--muted);
}


/* -----------------------
   MOBILE
   ----------------------- */

@media (max-width: 700px) {

    .pm-layout {
        grid-template-columns: 1fr;

        min-height: 0;
    }

    .pm-dialog-list {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .pm-dialog {
        min-height: 54px;
    }

    .pm-message.mine,
    .pm-message.theirs {
        margin-left: 0;
        margin-right: 0;
    }

}



/* ==========================================================
   POLYBIUS — inline PM composer
   ========================================================== */

/* Само окно диалога имеет ограниченную высоту */
.pm-conversation {
    height: 560px !important;
    min-height: 560px !important;
    max-height: 560px !important;

    overflow: hidden !important;
}


/* История занимает всё свободное место и скроллится */
.pm-thread {
    flex: 1 1 auto !important;

    min-height: 0 !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    scrollbar-width: thin;
}


/* Поле отправки всегда остаётся снизу */
.pm-inline-compose {
    box-sizing: border-box;

    display: grid;

    grid-template-columns: minmax(0, 1fr) auto;

    gap: 7px;

    flex: 0 0 auto;

    width: 100%;

    padding: 8px;

    border-top: 1px solid var(--line);

    background: #020a12;
}


.pm-inline-compose textarea {
    box-sizing: border-box;

    width: 100%;
    height: 58px;

    resize: none;

    padding: 7px;

    border: 1px solid var(--line);

    background: #00060b;
    color: #d5ddd6;

    font: 11px/1.35 "Courier New", monospace;
}


.pm-inline-compose textarea:focus {
    outline: 1px solid var(--accent-dark);
}


.pm-inline-compose .old-btn {
    align-self: stretch;

    min-width: 92px;
}


/* Телефон */
@media (max-width: 700px) {

    .pm-conversation {
        height: 520px !important;
        min-height: 520px !important;
        max-height: 520px !important;
    }

    .pm-inline-compose {
        grid-template-columns: 1fr;
    }

    .pm-inline-compose textarea {
        height: 64px;
    }

    .pm-inline-compose .old-btn {
        min-height: 34px;
    }

}



/* ==========================================================
   POLYBIUS — presence status
   ========================================================== */

.presence-status {
    font-family: "Courier New", monospace !important;
    font-size: 12px !important;
    font-weight: bold !important;
    text-transform: lowercase !important;
}

.presence-online {
    color: #54d98c !important;
}

.presence-offline {
    color: #e45b62 !important;
}



/* ==========================================================
   POLYBIUS — members online/offline
   ========================================================== */

.member-card-info {
    min-width: 0;
}

.member-card-info > b {
    display: block;
}

.member-presence {
    display: block !important;

    margin-top: 5px !important;

    font-family: "Courier New", monospace !important;
    font-size: 10px !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

.member-presence.presence-online {
    color: #54d98c !important;
}

.member-presence.presence-offline {
    color: #e45b62 !important;
}


/* mobile */
@media (max-width: 700px) {

    .member-presence {
        margin-top: 4px !important;
        font-size: 10px !important;
    }

}



/* ==========================================================
   POLYBIUS — profile text wrapping
   Сохраняем Enter + нормально переносим длинный текст
   ========================================================== */

.profile-grid {
    min-width: 0 !important;
}

.profile-grid dl {
    min-width: 0 !important;
}

.profile-grid dd {
    min-width: 0 !important;
    max-width: 100% !important;

    /* Сохраняет переносы строк, введённые пользователем */
    white-space: pre-wrap !important;

    /* Не даёт длинным словам/ссылкам вылезать за границы */
    overflow-wrap: anywhere !important;
    word-break: break-word !important;

    line-height: 1.4 !important;
}


/* Названия полей остаются сверху строки */
.profile-grid dt {
    align-self: start !important;
}


/* MOBILE */
@media (max-width: 700px) {

    .profile-grid dl {
        min-width: 0 !important;
        width: 100% !important;
    }

    .profile-grid dd {
        min-width: 0 !important;
        width: auto !important;

        white-space: pre-wrap !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

}


/* =========================================================
   MEMBER PROFILE FIX
   ========================================================= */

.member-profile-card {
    margin-top: 6px !important;
}

.member-profile-grid {
    display: grid !important;
    grid-template-columns: 180px minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: start !important;
    padding: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.member-profile-side {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    min-width: 0 !important;
}

.member-profile-side .big-avatar {
    width: 160px !important;
    height: 160px !important;
    min-width: 160px !important;
    min-height: 160px !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 2px solid var(--line) !important;
    box-sizing: border-box !important;
}

.member-profile-side .big-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.member-profile-actions {
    width: 100% !important;
}

.member-profile-actions .old-btn {
    display: inline-block !important;
    width: auto !important;
}

.member-profile-main {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
}

.member-profile-row {
    display: grid !important;
    grid-template-columns: 150px minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: start !important;
    border-bottom: 1px solid var(--line-soft) !important;
}

.member-profile-label,
.member-profile-value {
    box-sizing: border-box !important;
    padding: 10px 8px !important;
    min-width: 0 !important;
}

.member-profile-label {
    color: var(--accent) !important;
    border-right: 1px solid var(--line-soft) !important;
    white-space: nowrap !important;
}

.member-profile-value {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    line-height: 1.45 !important;
}

.member-profile-text {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

.status-online {
    color: #58ff8a !important;
    font-weight: 700 !important;
}

.status-offline {
    color: #ff6b6b !important;
    font-weight: 700 !important;
}

/* mobile */
@media (max-width: 700px) {
    .member-profile-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 10px !important;
    }

    .member-profile-side {
        align-items: center !important;
    }

    .member-profile-side .big-avatar {
        width: 140px !important;
        height: 140px !important;
        min-width: 140px !important;
        min-height: 140px !important;
    }

    .member-profile-actions {
        text-align: center !important;
    }

    .member-profile-row {
        grid-template-columns: 110px minmax(0, 1fr) !important;
    }

    .member-profile-label,
    .member-profile-value {
        padding: 9px 7px !important;
    }
}


/* ==========================================================
   POLYBIUS — PRIVATE MESSAGE NOTIFICATION
   ========================================================== */

.pm-nav-link {
    position: relative !important;
    overflow: visible !important;
}


/* число непрочитанных */
.pm-unread-badge {
    position: absolute !important;

    top: -7px !important;
    right: -7px !important;

    min-width: 18px !important;
    height: 18px !important;

    box-sizing: border-box !important;

    padding: 1px 4px !important;

    border: 1px solid #e1a0aa !important;

    background: #8d3444 !important;
    color: #fff !important;

    font: bold 10px/14px "Courier New", monospace !important;

    text-align: center !important;

    z-index: 100000 !important;

    pointer-events: none !important;
}

.pm-unread-badge[hidden] {
    display: none !important;
}


@keyframes pm-unread-pop {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.45);
    }

    100% {
        transform: scale(1);
    }
}

.pm-unread-pop {
    animation: pm-unread-pop .45s ease-out !important;
}


/* всплывающее уведомление */
.pm-notification-toast {
    position: fixed !important;

    top: 14px !important;
    right: 14px !important;

    display: flex !important;
    align-items: center !important;

    gap: 9px !important;

    max-width: 340px !important;

    box-sizing: border-box !important;

    padding: 10px 13px !important;

    border: 2px solid var(--line) !important;

    background: #020b13 !important;
    color: var(--accent) !important;

    box-shadow:
        inset 0 0 0 1px #071821,
        0 3px 14px rgba(0,0,0,.65) !important;

    font: 12px "Courier New", monospace !important;

    text-align: left !important;

    cursor: pointer !important;

    opacity: 0 !important;

    transform: translateY(-12px) !important;

    transition:
        opacity .2s ease,
        transform .2s ease !important;

    z-index: 2147483647 !important;
}

.pm-notification-toast.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.pm-notification-icon {
    flex: 0 0 auto !important;

    font-size: 21px !important;
    line-height: 1 !important;

    color: #b7e7cd !important;
}

.pm-notification-text {
    min-width: 0 !important;

    overflow-wrap: anywhere !important;
}


/* mobile */
@media (max-width: 700px) {

    .pm-notification-toast {
        top: 8px !important;
        right: 8px !important;
        left: 8px !important;

        width: auto !important;
        max-width: none !important;

        padding: 9px 11px !important;

        font-size: 11px !important;
    }

    .pm-unread-badge {
        top: -5px !important;
        right: -5px !important;
    }

}



/* ==========================================================
   POLYBIUS — ADMIN CHARACTER COMMENTS
   ========================================================== */

.admin-comment-shell {
    margin-top: 6px !important;
}


.admin-comment-intro {
    padding: 9px 11px !important;

    border-bottom: 1px solid var(--line-soft) !important;

    color: #8fa397 !important;

    font: 11px/1.4 "Courier New", monospace !important;
}


.admin-comment-form {
    padding: 12px !important;
}


.admin-comment-top {
    display: grid !important;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(220px, 1fr) !important;

    gap: 10px !important;

    margin-bottom: 9px !important;
}


.admin-comment-top label,
.admin-comment-body {
    min-width: 0 !important;
}


.admin-comment-top select {
    width: 100% !important;

    box-sizing: border-box !important;
}


.admin-comment-body textarea {
    box-sizing: border-box !important;

    width: 100% !important;

    min-height: 150px !important;

    resize: vertical !important;
}


.admin-comment-submit {
    display: flex !important;

    align-items: center !important;

    gap: 8px !important;

    margin-top: 10px !important;

    flex-wrap: wrap !important;
}


.admin-comment-back {
    padding: 0 12px 12px !important;
}


.admin-comment-button {
    font-weight: bold !important;
}


/* MOBILE */
@media (max-width: 700px) {

    .admin-comment-form {
        padding: 8px !important;
    }

    .admin-comment-top {
        grid-template-columns: 1fr !important;

        gap: 7px !important;
    }

    .admin-comment-body textarea {
        min-height: 125px !important;
    }

    .admin-comment-submit {
        display: grid !important;

        grid-template-columns: 1fr !important;
    }

    .admin-comment-submit .old-btn {
        width: 100% !important;

        box-sizing: border-box !important;
    }

}



/* ==========================================================
   POLYBIUS — USER REPLY / LONG NICK FIX
   ========================================================== */


/* ----------------------------------------------------------
   Ник никогда не имеет права раздвигать колонку автора
   ---------------------------------------------------------- */

.post-author {
    box-sizing: border-box !important;

    min-width: 0 !important;
    max-width: 145px !important;

    overflow: hidden !important;
}


.post-username {
    box-sizing: border-box !important;

    display: block !important;

    width: 100% !important;
    max-width: 100% !important;

    margin-left: auto !important;
    margin-right: auto !important;

    white-space: normal !important;

    overflow-wrap: anywhere !important;
    word-break: break-word !important;

    text-align: center !important;
}


.post-username b {
    display: block !important;

    max-width: 100% !important;

    white-space: normal !important;

    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}


/* Особенно длинные ники чуть компактнее */
.post-username-long {
    font-size: 11px !important;
    line-height: 1.15 !important;

    letter-spacing: -0.2px !important;
}


/* ----------------------------------------------------------
   Кнопка "Ответить"
   ---------------------------------------------------------- */

.post-reply-user {
    display: block !important;

    width: auto !important;
    min-width: 0 !important;
    height: auto !important;

    margin: 7px auto 2px !important;

    padding: 3px 8px !important;

    font-size: 9px !important;
    line-height: 1.2 !important;

    cursor: pointer !important;
}


/* ----------------------------------------------------------
   Упоминание внутри сообщения
   ---------------------------------------------------------- */

.post-mention {
    color: var(--accent) !important;

    font-weight: bold !important;

    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-underline-offset: 2px !important;

    overflow-wrap: anywhere !important;
}


.post-mention:hover {
    text-decoration-style: solid !important;
}


.post-mention-deleted {
    color: #777 !important;
    text-decoration: none !important;
}


/* ----------------------------------------------------------
   MOBILE
   ---------------------------------------------------------- */

@media (max-width: 700px) {

    .post-author {
        max-width: 105px !important;
    }

    .post-username {
        font-size: 10px !important;
    }

    .post-username-long {
        font-size: 8px !important;
        line-height: 1.12 !important;
    }

    .post-reply-user {
        margin-top: 5px !important;

        padding: 3px 5px !important;

        font-size: 8px !important;
    }

}



/* ==========================================================
   POLYBIUS — mentions / delete comments
   ========================================================== */


/* Упоминание пользователя */
.post-mention {
    color: var(--accent) !important;

    font-weight: bold !important;

    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-underline-offset: 2px !important;

    overflow-wrap: anywhere !important;
}


.post-mention:hover {
    color: #c9f1dc !important;

    text-decoration-style: solid !important;
}


.post-mention-missing {
    color: #777 !important;

    text-decoration: none !important;
}


/* Блок управления комментарием */
.admin-comment-controls {
    display: flex !important;

    justify-content: flex-end !important;

    padding: 3px 9px 7px !important;
}


.admin-comment-controls form {
    margin: 0 !important;
    padding: 0 !important;
}


/* Намеренно выглядит как маленькая форумная ссылка,
   а не огромная красная кнопка */
.post-delete-button {
    appearance: none !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    background: transparent !important;

    color: #a96868 !important;

    font: 9px "Courier New", monospace !important;

    text-decoration: underline !important;

    cursor: pointer !important;
}


.post-delete-button:hover {
    color: #e27b7b !important;
}


/* mobile */
@media (max-width: 700px) {

    .admin-comment-controls {
        padding: 3px 7px 6px !important;
    }

    .post-delete-button {
        font-size: 9px !important;
    }

}



/* ==========================================================
   POLYBIUS — final mentions
   ========================================================== */

.post-mention {
    color: var(--accent) !important;

    font-weight: bold !important;

    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-underline-offset: 2px !important;

    overflow-wrap: anywhere !important;
}

.post-mention:hover {
    color: #d1f5e1 !important;

    text-decoration-style: solid !important;
}

.post-mention-missing {
    color: #777 !important;
}



/* ==========================================================
   POLYBIUS — post multi-media gallery
   ========================================================== */

.post-media-list {
    box-sizing: border-box !important;

    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    gap: 8px !important;

    width: 100% !important;
    min-width: 0 !important;

    padding: 0 8px 8px !important;
}


.post-media-list .post-media {
    box-sizing: border-box !important;

    min-width: 0 !important;

    margin: 0 !important;
}


.post-media-list .post-media img {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;

    object-fit: contain !important;
}


.post-media-list .post-media video {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}


.post-media-list .post-media audio {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
}


/*
 * Если медиа одно — растягиваем его на обе колонки,
 * чтобы старый вид одиночной картинки сохранился.
 */
.post-media-list > .post-media:only-child {
    grid-column: 1 / -1 !important;
}


/* file-name не раздвигает форму */
.file-picker .file-name {
    min-width: 0 !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}


/* MOBILE */
@media (max-width: 700px) {

    .post-media-list {
        grid-template-columns: 1fr !important;

        gap: 6px !important;

        padding: 0 6px 6px !important;
    }

    .post-media-list > .post-media {
        grid-column: auto !important;
    }

}



/* ==========================================================
   POLYBIUS — MULTI MEDIA V2
   ========================================================== */

.post-media-list {
    box-sizing: border-box !important;

    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    gap: 8px !important;

    width: 100% !important;
    min-width: 0 !important;

    padding: 6px 8px 9px !important;
}


.post-media-list .post-media {
    box-sizing: border-box !important;

    min-width: 0 !important;

    margin: 0 !important;
}


.post-media-image img {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;

    object-fit: contain !important;
}


/* Аудио и видео занимают всю ширину */
.post-media-audio,
.post-media-video {
    grid-column: 1 / -1 !important;
}


.post-media-video video {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}


.post-media-filename {
    margin-bottom: 5px !important;

    color: var(--accent) !important;

    font: 10px "Courier New", monospace !important;

    overflow-wrap: anywhere !important;
}


/* ==========================================================
   POLYBIUS AUDIO PLAYER
   ========================================================== */

.poly-audio-player {
    box-sizing: border-box !important;

    width: 100% !important;

    padding: 8px 10px !important;

    border: 1px solid var(--line) !important;

    background: #020b12 !important;

    box-shadow:
        inset 0 0 0 1px #071820 !important;
}


/* Настоящий browser player скрыт */
.poly-audio-element {
    display: none !important;
}


/* Имя песни */
.poly-audio-title {
    min-width: 0 !important;

    margin-bottom: 7px !important;
    padding-bottom: 6px !important;

    border-bottom:
        1px solid var(--line-soft) !important;

    color: var(--accent) !important;

    font:
        11px/1.25
        "Courier New",
        monospace !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}


/* Нижняя строка */
.poly-audio-controls {
    display: flex !important;

    align-items: center !important;

    gap: 7px !important;

    min-width: 0 !important;
}


/* Play */
.poly-audio-play {
    box-sizing: border-box !important;

    flex: 0 0 28px !important;

    width: 28px !important;
    height: 25px !important;

    padding: 0 !important;

    border:
        1px solid var(--line) !important;

    background:
        #07141b !important;

    color:
        var(--accent) !important;

    font:
        12px/23px
        "Courier New",
        monospace !important;

    text-align: center !important;

    cursor: pointer !important;
}


.poly-audio-play:hover {
    background:
        #0a1d24 !important;
}


/* Таймер */
.poly-audio-current,
.poly-audio-duration {
    flex: 0 0 auto !important;

    color: #91a69a !important;

    font:
        9px
        "Courier New",
        monospace !important;
}


/* Progress */
.poly-audio-progress {
    appearance: none !important;
    -webkit-appearance: none !important;

    flex: 1 1 auto !important;

    min-width: 80px !important;

    height: 5px !important;

    margin: 0 !important;
    padding: 0 !important;

    border:
        1px solid var(--line-soft) !important;

    background:
        #07131a !important;

    cursor: pointer !important;
}


/* Chrome */
.poly-audio-progress::-webkit-slider-thumb,
.poly-audio-volume::-webkit-slider-thumb {
    appearance: none !important;
    -webkit-appearance: none !important;

    width: 9px !important;
    height: 13px !important;

    border:
        1px solid var(--accent) !important;

    border-radius: 0 !important;

    background:
        #0c211b !important;

    cursor: pointer !important;
}


/* Firefox */
.poly-audio-progress::-moz-range-thumb,
.poly-audio-volume::-moz-range-thumb {
    width: 9px !important;
    height: 13px !important;

    border:
        1px solid var(--accent) !important;

    border-radius: 0 !important;

    background:
        #0c211b !important;

    cursor: pointer !important;
}


/* Volume */
.poly-audio-volume-wrap {
    display: flex !important;

    align-items: center !important;

    gap: 4px !important;

    flex: 0 0 auto !important;

    color: #81958a !important;

    font:
        8px
        "Courier New",
        monospace !important;
}


.poly-audio-volume {
    appearance: none !important;
    -webkit-appearance: none !important;

    width: 75px !important;
    height: 5px !important;

    margin: 0 !important;
    padding: 0 !important;

    border:
        1px solid var(--line-soft) !important;

    background:
        #07131a !important;

    cursor: pointer !important;
}


/* Выбранные имена файлов не ломают форму */
.file-picker .file-name {
    min-width: 0 !important;

    overflow: hidden !important;

    white-space: nowrap !important;

    text-overflow: ellipsis !important;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 700px) {

    .post-media-list {
        grid-template-columns:
            1fr !important;

        gap: 6px !important;

        padding:
            5px 6px 7px !important;
    }


    .post-media-list .post-media {
        grid-column:
            auto !important;
    }


    .poly-audio-player {
        padding:
            7px 8px !important;
    }


    .poly-audio-controls {
        gap:
            5px !important;

        flex-wrap:
            wrap !important;
    }


    .poly-audio-progress {
        min-width:
            100px !important;
    }


    .poly-audio-volume-wrap {
        margin-left:
            auto !important;
    }


    .poly-audio-volume {
        width:
            60px !important;
    }

}



/* ==========================================================
   POLYBIUS — TRUE MULTI MEDIA
   ========================================================== */


/* ---------- выбранные файлы ---------- */

.poly-media-queue {
    display: grid !important;

    gap: 3px !important;

    margin-top: 5px !important;
}


.poly-media-queue-item {
    box-sizing: border-box !important;

    display: grid !important;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        20px !important;

    gap: 7px !important;

    align-items: center !important;

    min-width: 0 !important;

    padding: 4px 5px !important;

    border:
        1px solid var(--line-soft) !important;

    background:
        #020a11 !important;

    font:
        9px
        "Courier New",
        monospace !important;
}


.poly-media-queue-name {
    min-width: 0 !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;

    color:
        var(--accent) !important;
}


.poly-media-queue-size {
    color:
        #778b80 !important;

    white-space:
        nowrap !important;
}


.poly-media-queue-remove {
    box-sizing:
        border-box !important;

    width:
        20px !important;

    height:
        20px !important;

    padding:
        0 !important;

    border:
        1px solid #715156 !important;

    background:
        #14080b !important;

    color:
        #d57d86 !important;

    line-height:
        17px !important;

    cursor:
        pointer !important;
}


/* ---------- опубликованные медиа ---------- */

.post-media-list {
    box-sizing:
        border-box !important;

    display:
        grid !important;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        ) !important;

    gap:
        8px !important;

    width:
        100% !important;

    min-width:
        0 !important;

    padding:
        7px 8px 9px !important;
}


.post-media-item {
    box-sizing:
        border-box !important;

    min-width:
        0 !important;
}


.post-media-image {
    border:
        1px solid
        var(--line-soft) !important;

    background:
        #010810 !important;

    padding:
        4px !important;
}


.post-media-image img {
    display:
        block !important;

    width:
        100% !important;

    max-width:
        100% !important;

    height:
        auto !important;

    object-fit:
        contain !important;
}


.post-media-name {
    margin-top:
        4px !important;

    color:
        #72877b !important;

    font:
        8px
        "Courier New",
        monospace !important;

    overflow:
        hidden !important;

    text-overflow:
        ellipsis !important;

    white-space:
        nowrap !important;
}


/* MP3 и видео — на всю ширину */
.poly-audio-player,
.post-media-video {
    grid-column:
        1 / -1 !important;
}


.post-media-video video {
    display:
        block !important;

    width:
        100% !important;

    height:
        auto !important;

    max-width:
        100% !important;
}


/* ---------- player ---------- */

.poly-audio-player {
    box-sizing:
        border-box !important;

    padding:
        8px 10px !important;

    border:
        1px solid
        var(--line) !important;

    background:
        #020b12 !important;

    box-shadow:
        inset 0 0 0 1px
        #071820 !important;
}


.poly-audio-element {
    display:
        none !important;
}


.poly-audio-title {
    margin-bottom:
        7px !important;

    padding-bottom:
        6px !important;

    border-bottom:
        1px solid
        var(--line-soft) !important;

    color:
        var(--accent) !important;

    font:
        11px
        "Courier New",
        monospace !important;

    overflow:
        hidden !important;

    text-overflow:
        ellipsis !important;

    white-space:
        nowrap !important;
}


.poly-audio-controls {
    display:
        flex !important;

    align-items:
        center !important;

    gap:
        7px !important;

    min-width:
        0 !important;
}


.poly-audio-play {
    flex:
        0 0 28px !important;

    width:
        28px !important;

    height:
        25px !important;

    padding:
        0 !important;

    border:
        1px solid
        var(--line) !important;

    background:
        #07151c !important;

    color:
        var(--accent) !important;

    cursor:
        pointer !important;
}


.poly-audio-current,
.poly-audio-duration {
    color:
        #85998e !important;

    font:
        9px
        "Courier New",
        monospace !important;
}


.poly-audio-progress {
    flex:
        1 1 auto !important;

    min-width:
        80px !important;
}


.poly-audio-volume-wrap {
    display:
        flex !important;

    align-items:
        center !important;

    gap:
        4px !important;

    color:
        #7d9286 !important;

    font:
        8px
        "Courier New",
        monospace !important;
}


.poly-audio-volume {
    width:
        70px !important;
}


/* ---------- MOBILE ---------- */

@media (max-width: 700px) {

    .post-media-list {
        grid-template-columns:
            1fr !important;

        padding:
            6px !important;
    }

    .post-media-item,
    .poly-audio-player,
    .post-media-video {
        grid-column:
            auto !important;
    }

    .poly-audio-controls {
        flex-wrap:
            wrap !important;
    }

    .poly-audio-volume-wrap {
        margin-left:
            auto !important;
    }

    .poly-media-queue-item {
        grid-template-columns:
            minmax(0, 1fr)
            20px !important;
    }

    .poly-media-queue-size {
        display:
            none !important;
    }

}



/* ==========================================================
   POLYBIUS — final audio states
   ========================================================== */

.poly-audio-player.poly-audio-playing {
    border-color: var(--accent) !important;
}

.poly-audio-player.poly-audio-playing .poly-audio-title {
    color: #c9f4dd !important;
}

.poly-audio-player.poly-audio-error {
    border-color: #8e4b54 !important;
}

.poly-audio-player.poly-audio-error .poly-audio-title {
    color: #df777f !important;
}

.poly-audio-player.poly-audio-error .poly-audio-play {
    color: #df777f !important;
    border-color: #8e4b54 !important;
}



/* ==========================================================
   POLYBIUS — media filenames
   Filename visible ONLY for audio
   ========================================================== */

/* Фото, GIF, видео — никаких названий файлов */
.post-media-image .post-media-name,
.post-media-video .post-media-name {
    display: none !important;
}

/* Старые подписи картинок от прошлых патчей */
.post-media-image figcaption,
.post-media-image .poly-image-label {
    display: none !important;
}

/* Аудио — имя песни остаётся */
.poly-audio-title {
    display: block !important;
}



/* ==========================================================
   POLYBIUS — LOCAL FONTS
   Jura Light = основной текст
   Tektur = заголовки
   ========================================================== */

@font-face {
    font-family: "Jura";
    src: url("/static/fonts/jura/Jura-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Jura";
    src: url("/static/fonts/jura/Jura-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Tektur";
    src: url("/static/fonts/tektur/Tektur-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Tektur";
    src: url("/static/fonts/tektur/Tektur-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}


/* ==========================================================
   ОСНОВНОЙ ТЕКСТ
   ========================================================== */

html,
body,
button,
input,
textarea,
select,
option {
    font-family: "Jura", sans-serif !important;
}

body {
    font-weight: 300 !important;
}


/* обычный текст */
.post-text,
.formatted-text,
.chat-line,
.pm-message-body,
.topic-preview,
.profile-card,
.member-card,
.classic-form,
.session-strip,
.last-cell,
.message-line {
    font-family: "Jura", sans-serif !important;
    font-weight: 300 !important;
}


/* Поля ввода чуть плотнее, чтобы Jura Light
   не была слишком тонкой в маленьком размере */
input,
textarea,
select,
button {
    font-weight: 400 !important;
}


/* ==========================================================
   TEKTUR — ЗАГОЛОВКИ
   ========================================================== */

.block-title,
.widget-title,
.thread-caption,
.board-name,
.topic-title-link,
.post-username,
.member-card b,
.pm-dialog-user,
.pm-conversation-head,
.admin-section h2,
.form-panel > .block-title,
.profile-card > .block-title {
    font-family: "Tektur", sans-serif !important;
    font-weight: 500 !important;
}


/* Главные заголовки чуть жирнее */
.block-title,
.widget-title,
.thread-caption {
    font-weight: 600 !important;
}


/* ==========================================================
   То, что лучше оставить терминальным
   ========================================================== */

.post-date,
.message-date,
.pm-message-meta,
.poly-audio-title,
.poly-audio-current,
.poly-audio-duration,
.poly-media-queue-item {
    font-family: "Jura", sans-serif !important;
}




/* ==========================================================
   POLYBIUS — JURA LIGHT SIZE ONLY
   Tektur headings are NOT touched
   ========================================================== */


/* Обычный текст сайта — совсем немного крупнее */
body {
    font-size: 14px !important;
}


/* Основной текст Jura */
.post-text,
.formatted-text,
.pm-message-body,
.chat-line,
.profile-card,
.classic-form,
.session-strip,
.last-cell,
.message-line {
    font-family: "Jura", sans-serif !important;
    font-weight: 300 !important;

    font-size: 14px !important;
    line-height: 1.4 !important;
}


/* Превью сообщений под названием темы */
.topic-preview,
.topic-excerpt,
.last-post-preview {
    font-family: "Jura", sans-serif !important;
    font-weight: 300 !important;

    font-size: 12px !important;
    line-height: 1.35 !important;
}


/* Табличный мелкий текст:
   Темы / Сообщения / Последнее сообщение */
th,
td,
.last-cell,
.forum-count,
.count-cell,
.stat-cell {
    font-family: "Jura", sans-serif !important;

    font-size: 14px !important;
}


/* Верхняя системная строка */
.session-strip,
.session-strip a {
    font-family: "Jura", sans-serif !important;
    font-weight: 300 !important;

    font-size: 13px !important;
}


/* Формы */
input,
textarea,
select,
button {
    font-family: "Jura", sans-serif !important;

    font-size: 14px !important;
}


/*
   ВАЖНО:
   Tektur здесь намеренно не указан.
   Заголовки остаются тех размеров,
   которые были ДО прошлого патча.
*/


/* ==========================================================
   POLYBIUS — force hooked arrow to TEXT, not iOS emoji
   ========================================================== */

.forum-hook-arrow {
    display: inline !important;

    font-family:
        "Times New Roman",
        "Arial",
        sans-serif !important;

    font-weight: 400 !important;
    font-style: normal !important;

    font-variant-emoji: text;

    color: var(--accent) !important;

    vertical-align: baseline !important;
}

/* iPhone/mobile */
@media (max-width: 700px) {
    .forum-hook-arrow {
        font-family:
            "Times New Roman",
            serif !important;

        font-size: 1em !important;
    }
}

