/* IZVORUM: responsive navigation, forms and comment identities. */
:root{color-scheme:dark;--header-height:76px}
html{scroll-padding-top:calc(var(--header-height) + 16px);-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-width:280px}
[hidden]{display:none!important}
.shell{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.layout>*,.profile-grid>*,.hero>*,.profile-bio,.comment-body,.user-meta,.admin-row>div{min-width:0}
.brand,.top-actions{flex-shrink:0}
.topbar{padding-top:env(safe-area-inset-top)}
.nav a{white-space:nowrap}
.nav .mobile-nav-only{display:none}
.hero-actions>.btn,.post-actions>.action,.profile-bio,.admin-row,.profile-bio h2,.footer-inner,.server-stat,.section-head,.user-meta{overflow-wrap:anywhere}
.hero-actions>.btn{max-width:100%}
.author-name,.comment-meta{display:flex!important;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.author-link,.profile-link{min-width:0;overflow-wrap:anywhere;max-width:100%}
.verified-badge{width:18px;height:18px;flex:0 0 18px;font-size:12px;vertical-align:middle}
.profile-bio .verified-badge{width:22px;height:22px;flex-basis:22px;font-size:14px}
.avatar{position:relative;isolation:isolate}
.avatar>[data-avatar-image]{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.comment{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:start;gap:10px;padding:12px 0;border-left:0;border-bottom:1px solid var(--line);color:var(--text);font-size:14px}
.comment-avatar-link{display:block;border-radius:12px;width:40px;height:40px}
.comment-avatar-link .avatar{width:40px;height:40px;border-radius:12px}
.comment-body{display:grid;gap:5px;overflow-wrap:anywhere}
.comment-author{flex:0 1 auto}
.comment-meta{line-height:1.5}
.comment-text{white-space:pre-wrap;overflow-wrap:anywhere}
.comment-body time{display:block;font-size:11px;color:var(--muted)}
.comment-delete{align-self:start;min-height:36px;padding:6px 8px;border-radius:8px}
.comment-delete:hover{background:#e8796315}
.comment-form{align-items:flex-end}
.comment-form textarea{display:block;min-width:0;flex:1;width:100%;min-height:74px;max-height:240px;resize:vertical;border:1px solid var(--line);background:#141b16;color:var(--text);border-radius:10px;padding:11px 12px}
.comment-form button{flex-shrink:0}
.modal-open{overflow:hidden}
.modal-backdrop{top:var(--visual-offset,0px);bottom:auto;height:var(--visual-height,100dvh);overflow-y:auto;overscroll-behavior:contain;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
.modal{max-height:100%;overscroll-behavior:contain;scroll-padding-block:20px}
.modal input:not([type=checkbox]),.modal textarea,.modal select{min-width:0;max-width:100%}
.modal .consent{flex-wrap:wrap}
.modal .consent input{min-height:0}
.modal .close{min-width:44px;min-height:44px;border-radius:8px}
.toast{max-width:calc(100% - 28px);width:max-content;text-align:center;overflow-wrap:anywhere;bottom:max(18px,env(safe-area-inset-bottom))}
@media(max-width:1100px){
  :root{--header-height:68px}
  .topbar-inner{height:68px;gap:12px;justify-content:space-between}
  .top-actions{margin-left:auto;gap:8px}
  .top-actions #rulesTop{display:none}
  .top-actions .btn.mobile-menu{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px;font-size:20px;line-height:1}
  .nav{position:absolute;top:100%;left:0;right:0;display:none;margin:0;padding:12px max(16px,env(safe-area-inset-right)) 16px max(16px,env(safe-area-inset-left));background:var(--bg);border-bottom:1px solid var(--line);box-shadow:0 14px 28px #0005;max-height:calc(100dvh - var(--header-height) - env(safe-area-inset-top));overflow-y:auto;overscroll-behavior:contain;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .nav.open{display:grid}
  .nav a,.nav .mobile-nav-only{display:flex;align-items:center;min-height:46px;padding:10px 12px;white-space:normal;font-size:14px}
  .btn,.btn.small,.action,.comment-delete,.text-tools button,.selected-photo button,.ip-copy{min-height:44px}
  .action,.text-tools button,.selected-photo>div button{min-width:44px}
  .selected-photo>div{flex-wrap:wrap}
  .upload-label{display:inline-flex;align-items:center;min-height:44px}
  .field,input:not([type=checkbox]):not([type=radio]):not([type=file]),textarea,select,.comment-form textarea,.modal input,.modal textarea,.modal select,.post-compose input:not([type=checkbox]):not([type=file]){font-size:16px}
  .field,input:not([type=checkbox]):not([type=radio]):not([type=file]),select{min-height:44px}
  .user-meta strong{line-height:1.4}
  .modal-backdrop{align-items:flex-start}
  .modal{margin:auto;max-height:100%;padding:20px}
  .post-actions{gap:4px}
  .photo-viewer button{min-height:44px;min-width:44px}
  .photo-toolbar{flex-wrap:wrap;gap:8px}
  .photo-tools{flex-wrap:wrap;justify-content:flex-end;min-width:0}
  .photo-bottom span{min-width:0}
}
@media(max-width:850px){
  .layout,.profile-grid{grid-template-columns:minmax(0,1fr)}
  .layout aside{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:640px){
  .shell{width:calc(100% - 24px)}
  .brand{gap:8px}
  .brand img{width:32px;height:32px}
  .brand-name{font-size:9px}
  .top-actions .primary{min-height:44px;padding:9px 12px;font-size:14px}
  .hero{gap:20px;padding-top:24px}
  h1{font-size:clamp(21px,5.9vw,32px);line-height:1.5;overflow-wrap:anywhere}
  .hero-actions{width:100%;gap:8px}
  .hero-actions>.btn{flex:1 1 100%;text-align:center}
  .section-head>.btn,.section-head>.hero-actions{width:100%}
  .hero-visual{min-height:180px}
  .server-strip{margin-bottom:28px}
  .server-stat{padding:12px}
  .card{padding:14px;border-radius:14px}
  .profile-cover{height:125px}
  .profile-top{align-items:flex-start;flex-wrap:wrap}
  .profile-top .avatar{width:66px;height:66px;flex:0 0 66px}
  .profile-bio{padding-top:36px;flex:1 1 150px}
  .profile-bio h2{font-size:19px}
  .profile-grid{gap:14px;margin-top:18px}
  .profile-top .tag{display:none}
  .post-head{flex-wrap:wrap;gap:9px}
  .post-head .user-meta{flex:1 1 130px}
  .post-head>.tag{margin-left:51px}
  .comment{grid-template-columns:38px minmax(0,1fr);gap:8px}
  .comment-avatar-link,.comment-avatar-link .avatar{width:38px;height:38px}
  .comment-delete{grid-column:2;justify-self:start;padding:6px 10px;margin-left:-10px}
  .comment-form{flex-wrap:wrap;gap:8px}
  .comment-form textarea{flex:1 1 100%}
  .comment-form button{margin-left:auto;min-width:112px}
  .compose-bottom,.compose-tools{width:100%;flex-wrap:wrap}
  .compose-bottom>.btn{width:100%}
  .admin-row,.admin-post-row{align-items:flex-start;flex-wrap:wrap;gap:10px}
  .admin-row>div,.admin-post-copy{flex:1 1 100%}
  .modal-backdrop{padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
  .modal{padding:16px;border-radius:14px}
  .modal-actions{flex-wrap:wrap}
  .modal-actions>.btn{flex:1 1 130px}
  .modal .tabs{flex-wrap:wrap}
  .post-compose fieldset,.modal fieldset{padding:10px}
  .link-row{padding:8px;gap:6px}
  .publication-links{align-items:flex-start}
  .footer-inner{gap:12px}
  .footer-inner>span:last-child{line-height:2.2}
  .footer{padding-bottom:max(24px,env(safe-area-inset-bottom))}
}
@media(pointer:coarse){.btn,.btn.small,.action,.text-tools button,.comment-delete,.photo-viewer button{min-height:44px}}
