:root {
  --bg: #f5f7f3;
  --surface: #ffffff;
  --surface-soft: #f0f5ef;
  --text: #26332c;
  --muted: #728078;
  --line: #dfe8df;
  --green: #4f7f62;
  --green-dark: #365f48;
  --green-soft: #dcebdd;
  --shadow: 0 12px 35px rgba(47, 78, 57, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: linear-gradient(180deg,#eef5ed 0,#f7f8f6 260px); color: var(--text); }
a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green); }
.container { width: min(1080px, calc(100% - 28px)); margin: 0 auto; }
.site-header { padding: 22px 0 12px; }
.header-inner { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.brand { display:flex; align-items:center; gap:12px; font-weight:800; font-size:22px; color:var(--text); }
.brand-mark { width:42px; height:42px; border-radius:15px; display:grid; place-items:center; background:var(--green); color:#fff; box-shadow:var(--shadow); }
.nav { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.nav a { padding:10px 14px; border-radius:12px; color:var(--text); font-weight:650; }
.nav a:hover { background:rgba(255,255,255,.7); }
.button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 18px; border:0; border-radius:14px; background:var(--green); color:#fff !important; font-weight:750; cursor:pointer; box-shadow:0 8px 20px rgba(79,127,98,.18); }
.button:hover { background:var(--green-dark); }
.button.secondary { background:var(--surface-soft); color:var(--green-dark)!important; box-shadow:none; }
.hero { margin:18px 0 24px; padding:34px; border:1px solid rgba(255,255,255,.8); border-radius:30px; background:rgba(255,255,255,.78); backdrop-filter:blur(12px); box-shadow:var(--shadow); }
.hero h1 { margin:0 0 10px; font-size:clamp(30px,6vw,48px); line-height:1.08; letter-spacing:-1.5px; }
.hero p { margin:0; color:var(--muted); font-size:17px; max-width:680px; line-height:1.65; }
.layout { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:22px; align-items:start; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.card-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:22px 24px 16px; }
.card-header h2,.card-header h1 { margin:0; font-size:22px; }
.card-body { padding:0 24px 24px; }
.category { display:flex; gap:16px; align-items:center; padding:18px; border:1px solid var(--line); border-radius:18px; margin-bottom:12px; transition:.2s ease; }
.category:hover { transform:translateY(-2px); border-color:#bfd2c2; background:#fbfdfb; }
.category-icon { flex:0 0 46px; width:46px; height:46px; border-radius:15px; display:grid; place-items:center; background:var(--green-soft); color:var(--green-dark); font-size:20px; }
.category h3 { margin:0 0 5px; font-size:17px; }
.category p { margin:0; color:var(--muted); font-size:14px; line-height:1.45; }
.online-card { padding:22px; }
.online-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.online-title { display:flex; align-items:center; gap:9px; font-weight:800; }
.dot { width:10px; height:10px; border-radius:50%; background:#54ad70; box-shadow:0 0 0 5px rgba(84,173,112,.14); }
.online-number { font-size:34px; font-weight:850; line-height:1; }
.online-link { display:block; padding:13px 15px; border-radius:14px; background:var(--surface-soft); text-align:center; font-weight:750; margin-top:16px; }
.muted { color:var(--muted); }
.page-card { max-width:760px; margin:24px auto; padding:28px; }
.form-grid { display:grid; gap:16px; }
label { display:block; margin-bottom:7px; font-size:14px; font-weight:750; }
input, textarea { width:100%; border:1px solid var(--line); border-radius:14px; padding:13px 14px; font:inherit; color:var(--text); background:#fcfdfc; outline:none; }
input:focus,textarea:focus { border-color:#8fb29a; box-shadow:0 0 0 4px rgba(79,127,98,.1); }
textarea { resize:vertical; min-height:110px; }
.notice { padding:13px 15px; border-radius:14px; background:var(--green-soft); color:var(--green-dark); margin-bottom:18px; }
.notice.error { background:#fce8e6; color:#9b413b; }
.user-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; }
.user-card { padding:18px 12px; border:1px solid var(--line); border-radius:18px; text-align:center; background:#fff; }
.avatar { width:72px; height:72px; border-radius:50%; object-fit:cover; display:block; margin:0 auto 11px; border:3px solid #edf4ed; background:var(--green-soft); }
.avatar-fallback { display:grid; place-items:center; color:var(--green-dark); font-weight:850; font-size:24px; }
.user-name { font-weight:800; overflow-wrap:anywhere; }
.user-login { color:var(--muted); font-size:13px; margin-top:3px; }
.profile-head { display:flex; gap:20px; align-items:center; margin-bottom:24px; }
.profile-head .avatar { width:112px; height:112px; margin:0; }
.footer { padding:34px 0; text-align:center; color:var(--muted); font-size:14px; }
.empty { padding:24px; border:1px dashed #cddacd; border-radius:16px; text-align:center; color:var(--muted); }
@media (max-width:800px){ .layout{grid-template-columns:1fr}.header-inner{align-items:flex-start}.hero{padding:25px}.nav{gap:4px}.nav a{padding:8px 9px} }
@media (max-width:560px){ .header-inner{display:block}.nav{justify-content:flex-start;margin-top:14px}.hero{border-radius:22px}.page-card{padding:20px}.profile-head{align-items:flex-start}.profile-head .avatar{width:88px;height:88px} }
.admin-layout { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(280px,.8fr); gap:22px; align-items:start; margin-bottom:30px; }
.admin-list { display:grid; gap:12px; }
.admin-user { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:16px; border:1px solid var(--line); border-radius:18px; }
.admin-user-main { display:flex; align-items:center; gap:14px; min-width:0; }
.admin-avatar { width:52px; height:52px; margin:0; flex:0 0 52px; font-size:18px; }
.admin-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.admin-actions form, .thread-admin-actions form { margin:0; }
.button.small { min-height:36px; padding:0 12px; font-size:13px; }
.button.danger { background:#b64e4e; }
.button.danger:hover { background:#913b3b; }
.button.warning { background:#b3873e; }
.button.warning:hover { background:#8b682f; }
.page-section { padding:22px; margin-bottom:22px; }
.page-section h2 { margin-top:0; }
.category-admin { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 0; border-bottom:1px solid var(--line); }
.category-admin:last-child { border-bottom:0; }
.badges { display:flex; gap:7px; flex-wrap:wrap; margin-top:7px; }
.badge { display:inline-flex; padding:4px 8px; border-radius:999px; background:var(--green-soft); color:var(--green-dark); font-size:12px; font-weight:750; }
.badge.danger { background:#f8dddd; color:#963d3d; }
.thread-admin-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:22px; }
@media (max-width:900px){ .admin-layout{grid-template-columns:1fr}.admin-user{align-items:flex-start;flex-direction:column}.admin-actions{justify-content:flex-start} }
.hero-actions{display:flex;align-items:center;justify-content:space-between;gap:20px}.narrow{max-width:860px}.form-card label{display:block;font-weight:700;margin:0 0 18px}.form-card input,.form-card textarea,.reply-form-card input,.reply-form-card textarea{width:100%;margin-top:8px}.badge{display:inline-flex;min-width:20px;height:20px;padding:0 6px;align-items:center;justify-content:center;border-radius:999px;background:#2f7d55;color:#fff;font-size:12px}.post-list{display:grid;gap:16px}.forum-post{display:grid;grid-template-columns:150px minmax(0,1fr);gap:20px;padding:20px;border:1px solid var(--border);border-radius:18px;background:#fff}.post-author{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px}.post-avatar{width:62px;height:62px;margin:0}.post-content{min-width:0}.message-text{line-height:1.65;overflow-wrap:anywhere}.message-text a{color:#287452;text-decoration:underline}.reply-preview{display:flex;flex-direction:column;gap:4px;padding:11px 14px;margin-bottom:14px;border-left:4px solid #7fbd99;background:#f0f8f3;border-radius:10px;color:var(--text)}.reply-preview span{color:var(--muted);font-size:13px}.post-images{display:grid;grid-template-columns:repeat(2,minmax(0,260px));gap:10px;margin-top:14px}.post-images img{display:block;width:100%;height:190px;object-fit:cover;border-radius:14px;border:1px solid var(--border)}.post-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;color:var(--muted)}.reply-button{border:0;background:transparent;color:#2f7d55;font-weight:700;cursor:pointer}.replying-to{display:flex;align-items:center;gap:6px;padding:10px 14px;margin-bottom:14px;background:#edf7f1;border-radius:12px}.replying-to button{margin-left:auto;border:0;background:transparent;font-size:24px;cursor:pointer}.notification-list{display:grid;gap:10px}.notification-item{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--border);border-radius:15px;color:var(--text)}.notification-item.unread{background:#edf8f1;border-color:#a8d2b8}.notification-item small{display:block;color:var(--muted);margin-top:5px}.small-avatar{width:46px;height:46px;margin:0;flex:0 0 auto}.alert.error{padding:12px 14px;margin-bottom:16px;border-radius:12px;background:#fff0f0;color:#9d3030}@media(max-width:700px){.hero-actions{align-items:flex-start;flex-direction:column}.forum-post{grid-template-columns:1fr;padding:16px}.post-author{flex-direction:row;text-align:left}.post-images{grid-template-columns:1fr}.post-images img{height:auto;max-height:360px}.post-meta{align-items:flex-end}}


/* Compact post image previews and full-screen viewer */
.post-images{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.post-image-link{display:block;width:150px;height:110px;border-radius:13px;overflow:hidden;border:1px solid var(--line);background:#eef3ef;cursor:zoom-in}
.post-images .post-image-link img{display:block;width:100%;height:100%;object-fit:cover;border:0;border-radius:0;transition:transform .2s ease}
.post-image-link:hover img{transform:scale(1.04)}
.image-lightbox[hidden]{display:none}
.image-lightbox{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(10,18,13,.88);backdrop-filter:blur(4px)}
.image-lightbox img{display:block;max-width:min(1100px,96vw);max-height:90vh;width:auto;height:auto;object-fit:contain;border-radius:16px;box-shadow:0 24px 80px rgba(0,0,0,.45)}
.image-lightbox-close{position:fixed;top:14px;right:16px;width:46px;height:46px;border:0;border-radius:50%;background:rgba(255,255,255,.94);color:#244532;font-size:32px;line-height:1;cursor:pointer;box-shadow:0 8px 25px rgba(0,0,0,.2)}
body.lightbox-open{overflow:hidden}
@media(max-width:700px){.post-images{display:flex;grid-template-columns:none}.post-image-link{width:104px;height:82px}.post-images .post-image-link img{height:100%;max-height:none}.image-lightbox{padding:12px}.image-lightbox img{max-width:96vw;max-height:86vh;border-radius:12px}}

/* Two-level forum header */
.forum-topbar{position:relative;z-index:100;background:var(--green);color:#fff;box-shadow:0 3px 14px rgba(28,68,45,.22);margin-bottom:22px}
.forum-toprow{height:76px;display:flex;align-items:center;gap:18px;color:#fff}
.top-brand{font-size:clamp(22px,4vw,34px);font-weight:650;letter-spacing:.01em;color:#fff!important;white-space:nowrap}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.top-icon-button{width:48px;height:48px;padding:0;border:0;background:transparent;color:#fff;display:grid;place-items:center;cursor:pointer;border-radius:14px;list-style:none}
.top-icon-button::-webkit-details-marker{display:none}.top-icon-button:hover{background:rgba(255,255,255,.12)}
.top-icon-button svg,.forum-icon-link svg{width:31px;height:31px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.top-menu-dropdown{position:relative}.top-menu-dropdown>summary{list-style:none}.top-dropdown-card{position:absolute;top:58px;left:0;min-width:205px;padding:8px;background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:0 16px 44px rgba(24,56,37,.22);display:grid;z-index:120}
.top-dropdown-card.right{left:auto;right:0}.top-dropdown-card a{padding:12px 13px;border-radius:10px;color:var(--text);font-weight:650}.top-dropdown-card a:hover{background:var(--surface-soft)}
.top-search{display:flex;gap:10px;padding-bottom:14px}.top-search[hidden]{display:none}.top-search input{margin:0;background:#fff;border:0;min-height:46px}.top-search button{border:0;border-radius:13px;padding:0 19px;background:#fff;color:var(--green-dark);font-weight:800;cursor:pointer}
.forum-icon-nav{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid rgba(255,255,255,.16);background:rgba(35,101,67,.35)}
.forum-icon-link{position:relative;min-height:91px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:rgba(255,255,255,.92)!important;border-right:1px solid rgba(255,255,255,.15);font-weight:700;font-size:12px;transition:.18s ease}
.forum-icon-link:last-child{border-right:0}.forum-icon-link:hover,.forum-icon-link.active{background:rgba(255,255,255,.13);color:#fff!important}.forum-icon-link svg{width:34px;height:34px}.nav-count{position:absolute;top:15px;left:calc(50% + 11px);min-width:20px;height:20px;padding:0 5px;border-radius:999px;display:grid;place-items:center;background:#fff;color:var(--green-dark);font-size:11px;box-shadow:0 3px 10px rgba(0,0,0,.16)}
.site-header{display:none}
@media(max-width:560px){.forum-topbar{margin-bottom:14px}.forum-toprow{height:62px;gap:8px}.top-icon-button{width:42px;height:42px}.top-icon-button svg{width:28px;height:28px}.top-brand{font-size:23px}.forum-icon-link{min-height:70px;gap:2px}.forum-icon-link svg{width:29px;height:29px}.forum-icon-link span{font-size:10px}.top-dropdown-card{top:50px}.top-search{padding-bottom:10px}.top-search button{padding:0 14px}}


/* Счётчик тем в разделах */
.category-main{min-width:0;flex:1}
.topic-count{margin-left:auto;min-width:66px;padding:8px 10px;border-radius:14px;background:#eef7f0;color:#3f7657;text-align:center;display:flex;flex-direction:column;line-height:1.05;flex-shrink:0}
.topic-count strong{font-size:1.05rem}
.topic-count small{font-size:.72rem;margin-top:3px;color:#688775}

/* Выбор эмодзи */
.emoji-picker-wrap{position:relative;margin:-4px 0 14px;width:max-content;max-width:100%}
.emoji-toggle{border:1px solid #d9e8dc;background:#f5faf6;color:#3f6f52;border-radius:12px;padding:8px 12px;font:inherit;font-weight:700;cursor:pointer;display:flex;align-items:center;gap:6px}
.emoji-toggle:hover{background:#eaf5ed}
.emoji-panel{position:absolute;z-index:40;left:0;top:calc(100% + 7px);width:280px;max-width:calc(100vw - 44px);padding:10px;border:1px solid #dce9df;border-radius:16px;background:#fff;box-shadow:0 16px 38px rgba(31,68,45,.18);display:grid;grid-template-columns:repeat(6,1fr);gap:4px}
.emoji-panel[hidden]{display:none}
.emoji-panel button{border:0;background:transparent;border-radius:9px;font-size:1.35rem;line-height:1;padding:7px 3px;cursor:pointer}
.emoji-panel button:hover{background:#eef7f0;transform:scale(1.08)}
@media(max-width:600px){.topic-count{min-width:56px;padding:7px 8px}.emoji-panel{grid-template-columns:repeat(6,1fr);width:260px}}


/* Чёткое визуальное разделение сообщений в теме */
.posts-section{margin-bottom:24px}
.posts-section .post-list{display:grid;gap:18px;padding:0;background:transparent}
.forum-post{position:relative;display:grid;grid-template-columns:170px minmax(0,1fr);gap:0;padding:0;overflow:hidden;border:1px solid #dce8df;border-radius:20px;background:#fff;box-shadow:0 8px 26px rgba(31,68,45,.08)}
.forum-post + .forum-post{margin-top:0}
.post-author{padding:22px 16px;background:linear-gradient(180deg,#eef7f0 0%,#f7fbf8 100%);border-right:1px solid #dce8df;display:flex;flex-direction:column;align-items:center;text-align:center;gap:9px}
.post-author strong{display:block;color:#315f43;overflow-wrap:anywhere}
.post-content{min-width:0;padding:22px 24px;background:#fff}
.message-text{min-height:44px;font-size:15px;line-height:1.72;color:#26372d;overflow-wrap:anywhere}
.post-meta{padding-top:14px;margin-top:18px;border-top:1px solid #edf2ee}
.post-meta small{display:inline-flex;align-items:center;gap:5px;color:#7a8b80}
.reply-button{padding:7px 11px;border-radius:10px;background:#eef7f0;color:#34704d;transition:.18s ease}
.reply-button:hover{background:#dfeee4}
.reply-preview{border:1px solid #d9eadf;border-left:4px solid #69a880;background:#f4faf6;box-shadow:none}
.post-images{padding-top:2px}
@media(max-width:700px){
 .posts-section .post-list{gap:14px}
 .forum-post{grid-template-columns:1fr;border-radius:17px}
 .post-author{padding:13px 15px;flex-direction:row;justify-content:flex-start;text-align:left;border-right:0;border-bottom:1px solid #dce8df}
 .post-author .post-avatar{width:46px;height:46px;flex:0 0 46px}
 .post-content{padding:17px 16px}
 .message-text{font-size:14px;line-height:1.65}
 .post-meta{margin-top:15px}
}

/* Стандартный аватар и поле пола */
.form-grid select{width:100%;margin-top:8px;min-height:46px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--text);padding:0 13px;font:inherit}
.avatar[src$="default-avatar.svg"]{background:#e8f3eb;object-fit:cover}
.profile-details{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0;padding:12px 14px;border-radius:13px;background:#f1f8f3;color:#456653}

/* Большое обновление сообщества: активные темы, просмотры, лайки и ранги */
.recent-topics-card{margin-top:22px}.recent-topics-card .card-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.recent-topic-list{display:grid;gap:9px}.recent-topic{display:flex;align-items:center;gap:13px;padding:13px;border:1px solid var(--line);border-radius:15px;color:var(--text);transition:.18s ease}.recent-topic:hover{background:#f4faf6;transform:translateY(-1px)}.recent-topic-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:#e9f5ed;font-size:20px;flex:0 0 auto}.recent-topic-main{min-width:0;display:flex;flex-direction:column;gap:5px}.recent-topic-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recent-topic-main small{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topic-metrics,.thread-row-metrics{margin-left:auto;display:flex;gap:8px;flex-shrink:0}.topic-metrics b,.thread-row-metrics b{padding:7px 9px;border-radius:10px;background:#eef7f1;color:#48745a;font-size:12px}.thread-row-metrics{flex-direction:column;align-items:flex-end}.user-rank,.profile-rank{display:inline-flex;align-items:center;justify-content:center;margin-top:2px;padding:5px 9px;border-radius:999px;background:#e5f3e9;color:#356747;font-size:12px;font-weight:800}.author-post-count{color:var(--muted);font-size:11px}.post-actions{display:flex;align-items:center;gap:8px}.like-form{margin:0}.like-button,.like-readonly{border:0;border-radius:10px;padding:7px 10px;background:#f5f7f5;color:#7a8a7f;font:inherit;font-weight:800;cursor:pointer}.like-button:hover{background:#fbecef;color:#bd4960}.like-button.liked{background:#fde9ed;color:#c23e58}.like-readonly{display:inline-flex}.profile-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}.profile-stats>div{text-align:center;padding:14px 8px;border-radius:15px;background:#eff7f1;border:1px solid #dbe9df}.profile-stats strong{display:block;font-size:23px;color:#2f6847}.profile-stats span{display:block;margin-top:3px;color:var(--muted);font-size:12px}.mini-topic{display:flex;justify-content:space-between;gap:12px;padding:12px 4px;border-bottom:1px solid var(--line);color:var(--text)}.mini-topic:last-child{border-bottom:0}.mini-topic small{color:var(--muted);white-space:nowrap}
@media(max-width:650px){.recent-topics-card .card-header{align-items:flex-start;flex-direction:column}.recent-topic{align-items:flex-start}.topic-metrics{flex-direction:column;gap:4px}.recent-topic-main small{white-space:normal}.thread-row{align-items:flex-start}.thread-row-metrics{gap:4px}.post-meta{align-items:center}.profile-stats{gap:7px}.profile-stats>div{padding:11px 5px}.profile-stats strong{font-size:20px}.mini-topic{flex-direction:column}.mini-topic small{white-space:normal}}

/* Улучшенная главная: свободные карточки последних обсуждений */
.recent-heading{padding-bottom:10px}
.recent-heading p{margin:7px 0 0;font-size:14px}
.recent-topic-list{display:grid;gap:14px!important}
.recent-topic{display:grid!important;grid-template-columns:48px minmax(0,1fr) auto;align-items:center!important;gap:16px!important;padding:17px 18px!important;border-radius:18px!important;background:#fff;box-shadow:0 5px 18px rgba(45,85,59,.05)}
.recent-topic:hover{border-color:#bfd8c6;background:#fbfefc;box-shadow:0 9px 24px rgba(45,85,59,.09)}
.recent-topic-icon{width:48px!important;height:48px!important;border-radius:15px!important}
.recent-topic-main{gap:8px!important;overflow:hidden}
.recent-topic-title{display:block;font-size:16px;line-height:1.35;white-space:normal!important;overflow-wrap:anywhere}
.recent-topic-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px 13px;color:var(--muted);font-size:12px;line-height:1.4}
.recent-topic-meta span{position:relative}
.recent-topic-meta span+span:before{content:"•";position:absolute;left:-9px;color:#adc0b2}
.topic-metrics{display:grid!important;grid-template-columns:repeat(2,minmax(70px,1fr));gap:8px!important;margin-left:0!important}
.topic-metrics b{min-width:76px;padding:8px 10px!important;text-align:center;font-size:15px!important;border-radius:12px!important}
.topic-metrics b span{display:block;margin-bottom:2px;color:#789082;font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}

/* Просторный публичный профиль */
.profile-page{max-width:900px}
.public-profile-card{max-width:none;margin:24px auto 22px;padding:30px}
.profile-hero{display:flex;align-items:center;gap:24px;padding-bottom:26px;border-bottom:1px solid var(--line)}
.profile-avatar-large{width:124px!important;height:124px!important;margin:0!important;flex:0 0 124px}
.profile-identity{min-width:0}
.profile-identity h1{margin:0 0 5px;font-size:clamp(30px,5vw,44px);line-height:1.05;overflow-wrap:anywhere}
.profile-login{color:var(--muted);font-size:17px}
.profile-badges{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin-top:13px}
.online-badge{display:inline-flex;align-items:center;gap:9px;padding:6px 11px;border-radius:999px;background:#f0f8f2;color:#3e7150;font-size:13px;font-weight:750}
.online-badge .dot{display:inline-block;flex:0 0 auto}
.public-profile-card .profile-stats{gap:14px;margin:26px 0}
.public-profile-card .profile-stats>div{padding:18px 10px;border-radius:17px}
.public-profile-card .profile-stats strong{font-size:28px}
.public-profile-card .profile-stats span{font-size:13px;margin-top:5px}
.profile-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:24px}
.profile-info-item{padding:15px 17px;border:1px solid var(--line);border-radius:15px;background:#fbfdfb}
.profile-info-item span{display:block;margin-bottom:5px;color:var(--muted);font-size:12px}
.profile-info-item strong{font-size:15px}
.profile-about{padding:21px;border-radius:18px;background:#f4f8f4}
.profile-about h2{margin:0 0 10px;font-size:20px}
.profile-about p{margin:0;color:#65766c;line-height:1.75;overflow-wrap:anywhere}
.profile-socials{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}
.profile-topics-card{margin-bottom:30px}
.mini-topic-list{display:grid;gap:10px}
.mini-topic{align-items:center;padding:14px 15px!important;border:1px solid var(--line)!important;border-radius:14px;background:#fff}
.mini-topic:hover{background:#f7fbf8;border-color:#c9ddce!important}
.mini-topic>span{display:flex;min-width:0;flex-direction:column;gap:4px}
.mini-topic strong{overflow-wrap:anywhere}
.mini-topic span small{color:var(--muted);font-size:11px}
.mini-topic time{color:var(--muted);font-size:12px;white-space:nowrap}

@media(max-width:650px){
 .recent-topic{grid-template-columns:42px minmax(0,1fr)!important;gap:12px!important;padding:15px!important}
 .recent-topic-icon{width:42px!important;height:42px!important}
 .topic-metrics{grid-column:1/-1;grid-template-columns:repeat(2,1fr)!important;width:100%}
 .topic-metrics b{padding:7px!important}
 .recent-topic-meta{gap:4px 11px}
 .public-profile-card{padding:21px;margin-top:18px}
 .profile-hero{align-items:flex-start;gap:16px;padding-bottom:21px}
 .profile-avatar-large{width:86px!important;height:86px!important;flex-basis:86px}
 .profile-identity h1{font-size:29px}
 .profile-login{font-size:14px}
 .profile-badges{margin-top:9px;gap:6px}
 .profile-rank,.online-badge{font-size:11px;padding:5px 8px}
 .public-profile-card .profile-stats{gap:8px;margin:20px 0}
 .public-profile-card .profile-stats>div{padding:14px 5px}
 .public-profile-card .profile-stats strong{font-size:22px}
 .profile-info-grid{grid-template-columns:1fr;gap:8px}
 .profile-about{padding:17px}
 .mini-topic{flex-direction:column;align-items:flex-start!important;gap:8px!important}
 .mini-topic time{white-space:normal}
}

/* Единая ширина страницы: блоки больше не растягивают мобильный экран */
html,body{width:100%;max-width:100%;overflow-x:hidden}
.forum-topbar{width:100%;max-width:100%}
.forum-toprow,.top-search{max-width:1080px}
.forum-icon-nav{width:100%;max-width:100%}
main.container{display:block;max-width:1080px}
.hero,.layout,.recent-topics-card{width:100%;max-width:100%;min-width:0}
.layout>*{width:100%;max-width:100%;min-width:0}
.card,.card-body,.category,.category-main{max-width:100%;min-width:0}
.category{width:100%}
.category h3,.category p{overflow-wrap:anywhere;word-break:normal}

@media(max-width:800px){
 .container{width:calc(100% - 28px);max-width:calc(100% - 28px)}
 .forum-toprow,.top-search{width:calc(100% - 28px);max-width:calc(100% - 28px)}
 .forum-icon-nav{grid-template-columns:repeat(4,minmax(0,1fr))}
 .forum-icon-link{min-width:0;overflow:hidden}
 .forum-icon-link span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .layout{grid-template-columns:minmax(0,1fr)}
 .layout>.card,.layout>.online-card{min-width:0}
}

@media(max-width:560px){
 .container{width:calc(100% - 24px);max-width:calc(100% - 24px)}
 .forum-toprow,.top-search{width:calc(100% - 24px);max-width:calc(100% - 24px)}
 .hero{padding:26px 24px}
 .card-header{padding-left:20px;padding-right:20px}
 .card-body{padding-left:20px;padding-right:20px}
 .category{gap:13px;padding:15px}
 .category-icon{flex-basis:44px;width:44px;height:44px}
 .topic-count{min-width:58px;padding:8px 7px}
}

/* DARK THEME */
:root {
  --border: var(--line);
  --danger-soft: #fce8e6;
  --danger-text: #9b413b;
}

html[data-theme="dark"] {
  --bg: #111813;
  --surface: #18221b;
  --surface-soft: #223027;
  --text: #e8f0ea;
  --muted: #9fb0a4;
  --line: #304038;
  --green: #42765a;
  --green-dark: #9bd1ad;
  --green-soft: #263d2e;
  --shadow: 0 14px 38px rgba(0, 0, 0, .28);
  --border: var(--line);
  --danger-soft: #3a2425;
  --danger-text: #ffb5ae;
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #0c1510 0, #111813 280px);
  color: var(--text);
}

html[data-theme="dark"] a { color: #a8d8b8; }
html[data-theme="dark"] a:hover { color: #d0efda; }
html[data-theme="dark"] .hero {
  border-color: rgba(144, 190, 159, .16);
  background: rgba(24, 34, 27, .88);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .user-card,
html[data-theme="dark"] .forum-post,
html[data-theme="dark"] .post-content,
html[data-theme="dark"] .recent-topic,
html[data-theme="dark"] .mini-topic,
html[data-theme="dark"] .top-dropdown-card,
html[data-theme="dark"] .emoji-panel {
  background: var(--surface);
  border-color: var(--line);
}
html[data-theme="dark"] .category:hover,
html[data-theme="dark"] .recent-topic:hover,
html[data-theme="dark"] .mini-topic:hover {
  background: #1d2b22;
  border-color: #4b6756 !important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .top-search input {
  background: #111a14;
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #78897e; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  border-color: #68967a;
  box-shadow: 0 0 0 4px rgba(104, 150, 122, .16);
}
html[data-theme="dark"] .notice { background: #263d2e; color: #b9e0c5; }
html[data-theme="dark"] .notice.error,
html[data-theme="dark"] .alert.error { background: var(--danger-soft); color: var(--danger-text); }
html[data-theme="dark"] .avatar { border-color: #304339; }
html[data-theme="dark"] .empty { border-color: #405046; }
html[data-theme="dark"] .button.secondary { background: var(--surface-soft); color: #bfe1c9 !important; }
html[data-theme="dark"] .badge.danger { background: #46282b; color: #ffb6bc; }
html[data-theme="dark"] .forum-topbar {
  background: #2f6046;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] .forum-icon-nav { background: rgba(7, 24, 14, .28); }
html[data-theme="dark"] .top-dropdown-card { box-shadow: 0 18px 46px rgba(0, 0, 0, .38); }
html[data-theme="dark"] .top-search button { background: #e5f1e8; color: #244b34; }
html[data-theme="dark"] .nav-count { background: #e6f3ea; color: #244b34; }
html[data-theme="dark"] .topic-count,
html[data-theme="dark"] .topic-metrics b,
html[data-theme="dark"] .thread-row-metrics b,
html[data-theme="dark"] .recent-topic-icon,
html[data-theme="dark"] .user-rank,
html[data-theme="dark"] .profile-rank,
html[data-theme="dark"] .profile-stats > div,
html[data-theme="dark"] .online-badge,
html[data-theme="dark"] .profile-details {
  background: #263d2e;
  color: #b8ddc4;
  border-color: #385343;
}
html[data-theme="dark"] .topic-count small,
html[data-theme="dark"] .topic-metrics b span { color: #93aa9a; }
html[data-theme="dark"] .emoji-toggle,
html[data-theme="dark"] .reply-button,
html[data-theme="dark"] .replying-to,
html[data-theme="dark"] .reply-preview,
html[data-theme="dark"] .profile-info-item,
html[data-theme="dark"] .profile-about,
html[data-theme="dark"] .post-image-link {
  background: #202f25;
  color: #b8ddc4;
  border-color: #385043;
}
html[data-theme="dark"] .emoji-toggle:hover,
html[data-theme="dark"] .emoji-panel button:hover,
html[data-theme="dark"] .reply-button:hover { background: #2c4333; }
html[data-theme="dark"] .notification-item.unread {
  background: #243c2c;
  border-color: #4c7359;
}
html[data-theme="dark"] .post-author {
  background: linear-gradient(180deg, #22362a 0%, #1c2a21 100%);
  border-color: var(--line);
}
html[data-theme="dark"] .post-author strong { color: #b8ddc4; }
html[data-theme="dark"] .message-text { color: var(--text); }
html[data-theme="dark"] .message-text a { color: #a8d8b8; }
html[data-theme="dark"] .post-meta { border-color: var(--line); }
html[data-theme="dark"] .post-meta small { color: var(--muted); }
html[data-theme="dark"] .like-button,
html[data-theme="dark"] .like-readonly { background: #222d26; color: #aab6ae; }
html[data-theme="dark"] .like-button:hover { background: #432c32; color: #ffb4c2; }
html[data-theme="dark"] .like-button.liked { background: #4b2831; color: #ffb2c0; }
html[data-theme="dark"] .profile-stats strong { color: #b8ddc4; }
html[data-theme="dark"] .profile-about p { color: #a9b8ae; }
html[data-theme="dark"] .recent-topic-meta span + span::before { color: #5f7667; }
html[data-theme="dark"] .image-lightbox-close { background: #e5eee7; color: #1f3d2b; }
html[data-theme="dark"] .avatar[src$="default-avatar.svg"] { background: #263d2e; }

.theme-toggle .theme-icon { display: grid; place-items: center; }
.theme-toggle .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display: grid; }

@media (prefers-reduced-motion: no-preference) {
  body, .card, .hero, .category, .forum-post, .post-content, .post-author,
  .recent-topic, .mini-topic, input, textarea, select, .top-dropdown-card {
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  }
}


/* Главная страница: последние обсуждения справа, пользователи онлайн снизу */
.home-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}
.recent-topics-sidebar {
  margin-top: 0;
  min-width: 0;
}
.recent-topics-sidebar .card-header {
  padding: 20px 18px 13px;
}
.recent-topics-sidebar .card-header h2 {
  font-size: 20px;
}
.recent-topics-sidebar .recent-heading p {
  font-size: 12px;
  line-height: 1.45;
}
.recent-topics-sidebar .card-body {
  padding: 0 14px 16px;
}
.recent-topics-sidebar .recent-topic-list {
  gap: 10px !important;
}
.recent-topics-sidebar .recent-topic {
  grid-template-columns: 38px minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 12px !important;
  border-radius: 15px !important;
}
.recent-topics-sidebar .recent-topic-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  font-size: 17px;
}
.recent-topics-sidebar .recent-topic-main {
  gap: 6px !important;
}
.recent-topics-sidebar .recent-topic-title {
  font-size: 14px;
}
.recent-topics-sidebar .recent-topic-meta {
  gap: 3px 10px;
  font-size: 10px;
}
.recent-topics-sidebar .topic-metrics {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  width: 100%;
  gap: 6px !important;
}
.recent-topics-sidebar .topic-metrics b {
  min-width: 0;
  padding: 6px 8px !important;
  font-size: 13px !important;
}
.online-card-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
}
.online-card-wide .online-top {
  flex: 0 0 auto;
  min-width: 190px;
  margin-bottom: 0;
  gap: 22px;
}
.online-card-wide .online-card-copy {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
}
.online-card-wide .online-link {
  margin-top: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
@media (max-width: 800px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
  .recent-topics-sidebar {
    margin-top: 0;
  }
  .recent-topics-sidebar .card-header {
    padding: 22px 24px 16px;
  }
  .recent-topics-sidebar .card-body {
    padding: 0 24px 24px;
  }
  .recent-topics-sidebar .recent-topic {
    grid-template-columns: 48px minmax(0, 1fr) auto !important;
    gap: 16px !important;
    padding: 17px 18px !important;
  }
  .recent-topics-sidebar .recent-topic-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 15px !important;
    font-size: 20px;
  }
  .recent-topics-sidebar .recent-topic-title {
    font-size: 16px;
  }
  .recent-topics-sidebar .recent-topic-meta {
    gap: 6px 13px;
    font-size: 12px;
  }
  .recent-topics-sidebar .topic-metrics {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(70px, 1fr)) !important;
    width: auto;
    gap: 8px !important;
  }
  .online-card-wide {
    flex-direction: column;
    align-items: stretch;
  }
  .online-card-wide .online-card-copy {
    justify-content: space-between;
  }
}
@media (max-width: 650px) {
  .recent-topics-sidebar .recent-topic {
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 15px !important;
  }
  .recent-topics-sidebar .recent-topic-icon {
    width: 42px !important;
    height: 42px !important;
  }
  .recent-topics-sidebar .topic-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100%;
  }
  .online-card-wide .online-card-copy {
    flex-direction: column;
    align-items: stretch;
  }
  .online-card-wide .online-link {
    text-align: center;
  }
}

/* Центр загрузок */
.forum-icon-nav{grid-template-columns:repeat(5,minmax(0,1fr))}
.downloads-page{padding-bottom:36px}
.downloads-hero{display:flex;align-items:center;justify-content:space-between;gap:28px}
.downloads-hero>div:first-child{min-width:0}
.hero-download-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;flex:0 0 auto}
.download-toolbar{padding:18px;margin-bottom:18px}
.download-search{display:grid;grid-template-columns:minmax(0,1fr) 190px auto;gap:10px;align-items:center}
.download-search select,.form-grid select{width:100%;min-height:48px;border:1px solid var(--line);border-radius:14px;padding:0 13px;font:inherit;color:var(--text);background:#fcfdfc;outline:none}
.download-search select:focus,.form-grid select:focus{border-color:#8fb29a;box-shadow:0 0 0 4px rgba(79,127,98,.1)}
.download-category-tabs{display:flex;align-items:center;gap:8px;overflow-x:auto;padding-top:14px;scrollbar-width:thin}
.download-category-tab{display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;padding:9px 12px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--text);font-size:13px;font-weight:750}
.download-category-tab:hover{background:var(--surface-soft)}
.download-category-tab.active{border-color:var(--green);background:var(--green);color:#fff}
.download-category-tab b{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--surface-soft);color:var(--green-dark);font-size:11px}
.download-category-tab.active b{background:rgba(255,255,255,.2);color:#fff}
.download-list{display:grid;gap:14px}
.download-card{display:grid;grid-template-columns:210px minmax(0,1fr);overflow:hidden}
.download-preview{position:relative;display:block;min-height:168px;background:var(--surface-soft);overflow:hidden}
.download-preview img{display:block;width:100%;height:100%;min-height:168px;object-fit:cover}
.download-preview>span:not(:first-child){position:absolute;left:12px;bottom:12px;padding:6px 9px;border-radius:999px;background:rgba(19,31,23,.78);color:#fff;font-size:11px;font-weight:750;backdrop-filter:blur(5px)}
.download-preview-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;color:var(--green-dark)}
.download-preview-placeholder>span{font-size:56px;line-height:1}
.download-preview-placeholder small{font-weight:850;letter-spacing:.08em}
.download-card-main{min-width:0;padding:20px 22px}
.download-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.download-card-top h2{margin:5px 0 0;font-size:22px;line-height:1.25;overflow-wrap:anywhere}
.download-category-label{display:flex;align-items:center;gap:7px;color:var(--green-dark);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.download-format{display:inline-flex;align-items:center;justify-content:center;min-width:48px;padding:7px 9px;border-radius:10px;background:var(--green-soft);color:var(--green-dark);font-size:11px;font-weight:850;letter-spacing:.05em}
.download-card-main>p{margin:12px 0;color:var(--muted);line-height:1.55;overflow-wrap:anywhere}
.download-meta{display:flex;align-items:center;flex-wrap:wrap;gap:7px 14px;color:var(--muted);font-size:12px}
.download-meta span{overflow-wrap:anywhere}
.download-card-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:16px}
.download-empty{padding:38px}
.pagination{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:20px;color:var(--muted)}
.pagination a{padding:9px 13px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-weight:750}
.download-upload-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;align-items:start}
.download-upload-card{min-width:0}
.file-input-card{padding:15px;border:1px dashed #bfd0c2;border-radius:16px;background:var(--surface-soft)}
.file-input-card input[type=file]{padding:10px;background:var(--surface)}
.file-input-card small{display:block;margin-top:8px;color:var(--muted);line-height:1.45}
.upload-screen-preview{margin-top:12px;width:180px;height:115px;overflow:hidden;border:1px solid var(--line);border-radius:13px;background:var(--surface)}
.upload-screen-preview img{display:block;width:100%;height:100%;object-fit:cover}
.upload-rules{display:flex;align-items:flex-start;gap:10px;margin:0!important;padding:13px;border-radius:14px;background:var(--surface-soft);font-weight:500!important;line-height:1.45}
.upload-rules input{width:18px;height:18px;flex:0 0 18px;margin:2px 0 0}
.upload-progress-note{padding:11px 13px;border-radius:12px;background:var(--green-soft);color:var(--green-dark);font-size:13px;font-weight:700}
.download-safety-card{padding:22px}
.download-safety-card h2{margin:0 0 18px}
.safety-item{display:flex;align-items:flex-start;gap:12px;padding:14px 0;border-bottom:1px solid var(--line)}
.safety-item:last-child{border-bottom:0}
.safety-item>span{font-size:25px;line-height:1}
.safety-item strong{display:block;margin-bottom:4px}
.safety-item p{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
.my-downloads-card{margin-top:22px}
.my-download-list{display:grid;gap:10px}
.my-download-item{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:13px;align-items:center;padding:13px;border:1px solid var(--line);border-radius:15px;color:var(--text)}
.my-download-item:hover{background:var(--surface-soft)}
.my-download-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:var(--green-soft);font-size:23px}
.my-download-main{display:flex;min-width:0;flex-direction:column;gap:4px}
.my-download-main strong{overflow-wrap:anywhere}
.my-download-main small{color:var(--muted);line-height:1.4}
.my-download-main em{color:#9b413b;font-size:12px;font-style:normal}
.download-status{display:inline-flex;align-items:center;justify-content:center;padding:6px 9px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.download-status.pending{background:#fff2ce;color:#866414}
.download-status.approved{background:#dff1e4;color:#386b49}
.download-status.rejected{background:#f7dddd;color:#993e3e}
.download-detail-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:20px;align-items:start}
.download-detail-card{overflow:hidden}
.download-detail-image{position:relative;display:block;max-height:520px;overflow:hidden;background:var(--surface-soft)}
.download-detail-image img{display:block;width:100%;max-height:520px;object-fit:contain;background:#101611}
.download-detail-image span{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);padding:7px 11px;border-radius:999px;background:rgba(15,25,18,.76);color:#fff;font-size:12px;font-weight:750;white-space:nowrap}
.download-detail-placeholder{display:grid;place-items:center;align-content:center;gap:12px;min-height:320px;background:var(--surface-soft)}
.download-detail-placeholder span{font-size:82px}
.download-detail-placeholder strong{letter-spacing:.1em;color:var(--green-dark)}
.download-detail-content{padding:24px}
.download-detail-content h2{margin:0 0 13px}
.download-description{line-height:1.72;overflow-wrap:anywhere}
.download-info-card{padding:23px;text-align:center}
.download-file-emblem{font-size:64px;line-height:1}
.download-info-card h2{margin:13px 0 19px;font-size:17px;overflow-wrap:anywhere}
.download-info-card dl{display:grid;gap:0;margin:0 0 18px;text-align:left}
.download-info-card dl div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}
.download-info-card dt{color:var(--muted);font-size:13px}
.download-info-card dd{margin:0;font-weight:750;text-align:right}
.download-main-button{display:flex;width:100%;margin-top:9px}
.download-warning{margin:16px 0 0;color:var(--muted);font-size:12px;line-height:1.55}
.admin-download-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:20px;align-items:start}
.admin-download-main{min-width:0}
.moderation-tabs{display:flex;align-items:center;gap:7px;padding:10px;margin-bottom:14px;overflow-x:auto}
.moderation-tabs a{display:flex;align-items:center;gap:7px;flex:0 0 auto;padding:9px 12px;border-radius:12px;color:var(--text);font-size:13px;font-weight:750}
.moderation-tabs a:hover{background:var(--surface-soft)}
.moderation-tabs a.active{background:var(--green);color:#fff}
.moderation-tabs b{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--surface-soft);color:var(--green-dark);font-size:11px}
.moderation-tabs a.active b{background:rgba(255,255,255,.2);color:#fff}
.moderation-list{display:grid;gap:14px}
.moderation-file{display:grid;grid-template-columns:180px minmax(0,1fr);overflow:hidden}
.moderation-preview{display:grid;place-items:center;min-height:210px;background:var(--surface-soft);font-size:62px;overflow:hidden}
.moderation-preview a,.moderation-preview img{display:block;width:100%;height:100%}
.moderation-preview img{object-fit:cover}
.moderation-content{min-width:0;padding:20px}
.moderation-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.moderation-head h2{margin:7px 0 0;font-size:21px;overflow-wrap:anywhere}
.moderation-content>p{max-height:190px;overflow:auto;color:var(--muted);line-height:1.55}
.moderation-note{margin-top:12px;padding:10px 12px;border-radius:12px;background:var(--surface-soft);font-size:13px}
.moderation-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:16px}
.moderation-actions form{margin:0}
.reject-download-form{display:flex;align-items:center;gap:7px;flex:1 1 300px}
.reject-download-form input{min-width:160px;padding:9px 10px}
button:disabled,.button:disabled{cursor:not-allowed;opacity:.5;box-shadow:none}

html[data-theme="dark"] .download-search select,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .file-input-card input[type=file]{background:#111a14;color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .download-category-tab,
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .upload-screen-preview{background:var(--surface);border-color:var(--line)}
html[data-theme="dark"] .download-category-tab:hover,
html[data-theme="dark"] .my-download-item:hover{background:#202f25}
html[data-theme="dark"] .download-category-tab.active,
html[data-theme="dark"] .moderation-tabs a.active{background:#42765a;color:#fff}
html[data-theme="dark"] .download-format,
html[data-theme="dark"] .my-download-icon,
html[data-theme="dark"] .upload-progress-note{background:#263d2e;color:#b8ddc4}
html[data-theme="dark"] .file-input-card,
html[data-theme="dark"] .upload-rules,
html[data-theme="dark"] .download-preview,
html[data-theme="dark"] .download-detail-placeholder,
html[data-theme="dark"] .moderation-preview,
html[data-theme="dark"] .moderation-note{background:#202f25;border-color:#385043}
html[data-theme="dark"] .download-status.pending{background:#493d20;color:#f2d67c}
html[data-theme="dark"] .download-status.approved{background:#263d2e;color:#b8ddc4}
html[data-theme="dark"] .download-status.rejected{background:#46282b;color:#ffb6bc}
html[data-theme="dark"] .download-detail-image img{background:#090e0b}
html[data-theme="dark"] .my-download-main em{color:#ffb6bc}

@media(max-width:900px){
 .download-card{grid-template-columns:180px minmax(0,1fr)}
 .download-upload-layout,.download-detail-layout,.admin-download-layout{grid-template-columns:1fr}
 .download-safety-card{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
 .download-safety-card h2{grid-column:1/-1}
 .safety-item{border:1px solid var(--line);border-radius:15px;padding:14px}
 .moderation-file{grid-template-columns:160px minmax(0,1fr)}
}
@media(max-width:800px){
 .forum-icon-nav{grid-template-columns:repeat(5,minmax(0,1fr))}
 .downloads-hero{align-items:flex-start;flex-direction:column}
 .hero-download-actions{justify-content:flex-start}
 .download-search{grid-template-columns:minmax(0,1fr) 170px auto}
}
@media(max-width:650px){
 .download-search{grid-template-columns:1fr}
 .download-search .button{width:100%}
 .download-card{grid-template-columns:1fr}
 .download-preview{min-height:180px;max-height:230px}
 .download-preview img{min-height:180px;max-height:230px}
 .download-card-main{padding:18px}
 .download-card-actions{justify-content:stretch}
 .download-card-actions .button{flex:1}
 .my-download-item{grid-template-columns:44px minmax(0,1fr)}
 .my-download-icon{width:44px;height:44px}
 .my-download-item>.download-status{grid-column:1/-1;justify-self:flex-start}
 .download-safety-card{display:block}
 .safety-item{margin-top:10px}
 .moderation-file{grid-template-columns:1fr}
 .moderation-preview{min-height:170px;max-height:230px}
 .moderation-preview img{max-height:230px}
 .reject-download-form{flex-direction:column;align-items:stretch}
 .reject-download-form input{width:100%}
 .download-detail-image span{max-width:calc(100% - 24px);white-space:normal;text-align:center}
}
@media(max-width:480px){
 .forum-icon-link{padding-left:2px;padding-right:2px;font-size:10px}
 .forum-icon-link svg{width:21px;height:21px}
 .download-card-top{gap:8px}
 .download-card-top h2{font-size:19px}
 .download-card-actions{flex-direction:column}
 .download-card-actions .button{width:100%}
 .pagination{gap:8px;font-size:12px}
 .download-detail-content,.download-info-card{padding:18px}
}
